Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.contrib.auth.models import Group, Permission
- from django.contrib.contenttypes.models import ContentType
- from meals.models import *
- import random
- random_food_list = '''
- Cucumber Salad With Sour Cream and Garlic
- Schnitzel
- Lasagne
- Gazpacho
- Tacos
- Coleslaw
- Quiche
- Apple Pie
- Cucumber Sandwiches
- Tiramisu
- Beef Wellington
- Gyros
- Hollandaise Sauce
- Chicken Noodle Soup
- French Onion Soup
- Fried Egg
- Aioli
- Eggs Benedict
- Souvlaki
- Chicken Nuggets
- Chili
- Mayonaise
- Cucumber Salad With Sour Cream and Garlic
- Honeymelon With Ham
- Pumpkin Soup
- Creme Brulee
- Lasagne
- Mashed Potato
- Spaetzle
- Bratkartoffeln
- Ravioli
- Beef Wellington
- Steak
- Duck
- Risotto
- Sweet & Sour Chicken (Cantonese Style)
- Chicken Noodle Soup
- Roast Chicken
- Ratatouille
- Gyros
- Fresh Spring Rolls
- Chicken Tikka Masala
- Roast Chicken
- Honeymelon With Ham
- Wrap
- Fresh Spring Rolls
- Porridge
- Spaghetti Bolognese
- Quesadilla
- Chicken Nuggets
- French Toast
- Macaroni Salad
- Gazpacho
- Chicken Wings
- Risotto
- Paella
- Sweet & Sour Chicken (Cantonese Style)
- Goulash
- Bratkartoffeln
- Barbecue
- Chicken Noodle Soup
- Bangers & Mash
- Falafal
- '''
- admin = User.objects.create_superuser(
- 'admin', 'admin@admin.com', 'test', Country.objects.get(pk=100),
- Group.objects.get(name='admin')
- )
- mod = User.objects.create_superuser(
- 'moderator', 'moderator@moderator.com', 'test', Country.objects.get(pk=42),
- Group.objects.get(name='moderator')
- )
- reg = User.objects.create_superuser(
- 'regular', 'regular@regular.com', 'test', Country.objects.get(pk=24),
- Group.objects.get(name='regular_user')
- )
- names = random_food_list.split('\n')
- names = [n for n in names if n.strip()]
- for n in names:
- type = MealType.objects.order_by('?').first()
- user = User.objects.order_by('?').first()
- public = random.choice([True, False])
- calories = random.randint(44, 620)
- meal = Meal.objects.create(title=n, type=type, user=user, public=public)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement