AI_Chatbot / management /commands /setup_master_questions.py
embedingHF's picture
Upload folder using huggingface_hub
ae677bb verified
Raw
History Blame Contribute Delete
1.86 kB
from django.core.management.base import BaseCommand
from ai_chatbot.models import MasterQuestion
class Command(BaseCommand):
help = 'Setup predefined master questions for property listings'
def handle(self, *args, **options):
questions = [
"What is the load shedding situation in this area?",
"Is there backup (UPS / Generator / Solar)?",
"Is Sui gas available?",
"Is water available 24/7?",
"Is the street paved or kacha?",
"Does water accumulate during rain?",
"Is parking inside or outside?",
"Is it safe for overnight parking?",
"How far is the nearest mosque?",
"Are schools, markets, and hospitals nearby?",
"Are there security guards?",
"Is CCTV installed?",
"Is the area considered safe at night?",
"Which internet services are available?",
"Any extra charges not mentioned? (maintenance, security, garbage)",
"Who pays utility bills?",
"Is the portion completely separate?",
"Is entrance shared with owner?",
"What is the monthly rent of the property?",
"What is the security deposit?",
"Is the rent negotiable?",
]
count = 0
for order, question in enumerate(questions, start=1):
obj, created = MasterQuestion.objects.get_or_create(
question=question,
defaults={'order': order, 'is_active': True}
)
if created:
count += 1
self.stdout.write(self.style.SUCCESS(f'✓ Added: {question[:50]}...'))
self.stdout.write(self.style.SUCCESS(f'\n✅ Successfully added {count} master questions!'))