Пример #1
0
instruct1 = "Hello! Welcome to my kitchen.|Today I am going to teach you how to cook the sliced cold chicken.|Cut a chicken to small pieces|add|add|Boil the chicken for 10 mins|Poul out all the water|add|Cut the greenonions|add|Congratuations! You have finished learning this dish!"
instruct2 = "Hello! Welcome to my kitchen.|Today I am going to teach you how to cook the Sichuan fish.|add|add|add|Fry 5min|add|Boil for 10mins.|add|Boil for 6mins|Congratuations! You have finished learning this dish!"
instruct3 = "Hello! Welcome to my kitchen.|Today I am going to teach you how to cook the bitter shrimp ball.|Slice the bitter melon and put it at the bottom.|add|add|add|Steam for 20mins|add|Congratuations! You have finished learning this dish!"

recipe1 = Recipe(id=1,recipename="sliced_cold_chicken", ingresorder="2 5 6 7", instruction = instruct1)
recipe2 = Recipe(id=2,recipename="sichuan_fish", ingresorder="11 10 1 5 4", instruction = instruct2)
recipe3 = Recipe(id=3,recipename="bitter_shrimp_ball", ingresorder="8 3 9 7", instruction = instruct3)
recipe4 = Recipe(id=4,recipename="crystal_shrimp", ingresorder="1", instruction = " ")
recipe5 = Recipe(id=5,recipename="buddha_Jumps_over_the_wall", ingresorder="1", instruction = " ")
recipe6 = Recipe(id=6,recipename="steamed_preserved_hams", ingresorder="1", instruction = " ")
recipe7 = Recipe(id=7,recipename="phoenix_peony_stew", ingresorder="1", instruction = " ")
recipe8 = Recipe(id=8,recipename="jellyfish_with_vinegar", ingresorder="1", instruction = " ")



recipe1.add_ingres([ingre2, ingre5, ingre6, ingre7])
recipe2.add_ingres([ingre4, ingre1, ingre5, ingre11, ingre10])
recipe3.add_ingres([ingre8, ingre3, ingre9, ingre7])


user1 = User( username = "******", password = "******")
user2 = User( username = "******", password = "******")


user1.add_recipes([ recipe1 , recipe3, recipe2, recipe4, recipe5, recipe6, recipe7, recipe8 ])
user2.add_recipes([ recipe2 , recipe1 ])

# commit the changes
db.session.commit()
Пример #2
0
recipe5 = Recipe(id=5,
                 recipename="buddha_Jumps_over_the_wall",
                 ingresorder="1",
                 instruction=" ")
recipe6 = Recipe(id=6,
                 recipename="steamed_preserved_hams",
                 ingresorder="1",
                 instruction=" ")
recipe7 = Recipe(id=7,
                 recipename="phoenix_peony_stew",
                 ingresorder="1",
                 instruction=" ")
recipe8 = Recipe(id=8,
                 recipename="jellyfish_with_vinegar",
                 ingresorder="1",
                 instruction=" ")

recipe1.add_ingres([ingre2, ingre5, ingre6, ingre7])
recipe2.add_ingres([ingre4, ingre1, ingre5, ingre11, ingre10])
recipe3.add_ingres([ingre8, ingre3, ingre9, ingre7])

user1 = User(username="******", password="******")
user2 = User(username="******", password="******")

user1.add_recipes(
    [recipe1, recipe3, recipe2, recipe4, recipe5, recipe6, recipe7, recipe8])
user2.add_recipes([recipe2, recipe1])

# commit the changes
db.session.commit()