Spaces:
Sleeping
Sleeping
| from database import SessionLocal | |
| from models import Restaurant, Review | |
| import random | |
| db = SessionLocal() | |
| # Find Spice Garden in the database | |
| spice_garden = db.query(Restaurant).filter(Restaurant.name == "Spice Garden").first() | |
| if not spice_garden: | |
| print("❌ Could not find 'Spice Garden' in the database. Please make sure the previous script ran successfully.") | |
| exit() | |
| # List of Indian names for the reviewers | |
| names = [ | |
| "Arun", "Bhavna", "Chetan", "Deepika", "Esha", "Farhan", "Gautam", "Hari", | |
| "Isha", "Jatin", "Kavita", "Lakshya", "Manish", "Nandini", "Omkar", "Prachi", | |
| "Qasim", "Rakesh", "Shruti", "Tanvi", "Utkarsh", "Vidya", "Wahid", "Yash", | |
| "Zoya", "Aakash", "Bhumika", "Chirag", "Disha", "Gaurika", "Harsh", "Jyoti", | |
| "Kunal", "Leena", "Mayank", "Nikhil", "Pallavi", "Raghav", "Sonal", "Tushar" | |
| ] | |
| # 50 Proper, Context-Specific Reviews with matching ratings | |
| reviews_data = [ | |
| ("The butter chicken here is simply divine! Creamy, rich, and perfectly spiced.", 5), | |
| ("Ordered the paneer tikka and it was so soft it melted in my mouth.", 5), | |
| ("Best dining experience for authentic North Indian food in the city.", 5), | |
| ("Service was a bit slow, but the garlic naan made up for it.", 4), | |
| ("The biryani lacked flavor today, usually it's much better.", 2), | |
| ("Had the executive thali. Amazing variety and extremely filling.", 5), | |
| ("Too oily! The curries were swimming in oil. Not recommended for health-conscious folks.", 2), | |
| ("A fantastic place for Sunday family lunches. Always crowded, so book ahead!", 4), | |
| ("The gulab jamuns were served piping hot and tasted heavenly.", 5), | |
| ("Overpriced for the portion size, though the taste is undeniably good.", 3), | |
| ("Really authentic dal makhani! Tastes just like the dhabas up North.", 5), | |
| ("Friendly staff and prompt service. We had a great time.", 4), | |
| ("The tandoori platter is a must-try for non-vegetarians.", 5), | |
| ("I found the vindaloo to be a bit too mild. Needs more spice!", 3), | |
| ("Fresh ingredients and you can really taste the quality of the ghee they use.", 5), | |
| ("The malai kofta was sweet and creamy, paired perfectly with butter roti.", 5), | |
| ("Very loud atmosphere, hard to have a conversation, but food is top-notch.", 4), | |
| ("Found a piece of bone in my boneless chicken curry. Disappointing.", 1), | |
| ("The mango lassi is the best way to end a spicy meal here.", 5), | |
| ("Absolutely love the mint chutney they serve with the papad!", 4), | |
| ("Highly recommend the fish tikka. Fresh catch and marinated beautifully.", 5), | |
| ("Portions are huge! One dish is easily enough for two people.", 5), | |
| ("A bit congested seating, we felt like we were sitting with the next table.", 3), | |
| ("Their chole bhature on weekends is the ultimate comfort food.", 5), | |
| ("Tried their special mutton rogan josh. The meat was falling off the bone.", 5), | |
| ("Avoid the desserts, they felt stale. Stick to the main courses.", 2), | |
| ("Consistently excellent. I’ve been coming here for years and it never drops in quality.", 5), | |
| ("The waiter gave great recommendations. The chef's special chicken was stellar.", 5), | |
| ("Great vegetarian options. The palak paneer was fresh and vibrant green.", 4), | |
| ("The AC was dripping near our table, ruined the mood entirely.", 1), | |
| ("Unbelievably good stuffed kulchas. Crispy outside, flavorful inside.", 5), | |
| ("Parking is a nightmare here, take a cab if you plan to visit.", 3), | |
| ("The spice levels are perfect—not too overwhelming, but very flavorful.", 4), | |
| ("Standard Indian fare. Nothing extraordinary, but definitely not bad.", 3), | |
| ("Best value for money restaurant in this area. Highly satisfied.", 5), | |
| ("The roomali roti was so soft and thin. Masterfully made!", 5), | |
| ("Ordered delivery and it arrived hot and neatly packed. No spills!", 5), | |
| ("The kadhai paneer had crunchy bell peppers and a great roasted spice aroma.", 4), | |
| ("Felt like the chicken was cooked yesterday and reheated. Very chewy.", 2), | |
| ("Five stars for the hygiene. Place is spotless and very well maintained.", 5), | |
| ("The jaljeera drink was super refreshing after walking in the heat.", 4), | |
| ("Everything was too spicy! My kids couldn't eat anything.", 2), | |
| ("Loved the traditional copper utensils they use to serve the food.", 4), | |
| ("Had to wait 45 minutes for a table. Management needs to handle crowds better.", 2), | |
| ("The chicken do pyaza had a wonderful sweetness from the onions.", 4), | |
| ("Great ambience with soothing classical Indian music in the background.", 5), | |
| ("The raita was watery and lacked seasoning. Small detail but it matters.", 3), | |
| ("One of the few places that gets the texture of mushroom masala right.", 4), | |
| ("Really enjoyed the complimentary welcome drink! Great hospitality.", 5), | |
| ("A flawless dinner. The combination of jeera rice and dal tadka is soul-satisfying.", 5) | |
| ] | |
| # Create Review objects | |
| bulk_reviews = [] | |
| for review_text, rating in reviews_data: | |
| bulk_reviews.append( | |
| Review( | |
| restaurant_id=spice_garden.id, | |
| user_name=random.choice(names), | |
| rating=rating, | |
| review=review_text | |
| ) | |
| ) | |
| # Insert into database | |
| db.add_all(bulk_reviews) | |
| db.commit() | |
| # Verify the count | |
| total_spice_garden_reviews = db.query(Review).filter(Review.restaurant_id == spice_garden.id).count() | |
| print("✅ Successfully added 50 new reviews for Spice Garden!") | |
| print(f"🌶️ Spice Garden now has a total of {total_spice_garden_reviews} reviews in the database.") |