haldis/app/database/add_oceans_garden.py

57 lines
1.4 KiB
Python
Raw Permalink Normal View History

2019-09-09 23:19:21 +02:00
"Script to add Ocean Garden to Haldis"
from itertools import product
2019-09-08 02:02:16 +02:00
from app import db
from models import Location, Product
zetmelen = ["Nasi", "Bami"]
vlezen = ["Rundsvlees", "Varkensvlees", "Kippenstukkjes"]
2019-09-05 03:33:29 +02:00
sauzen = [
"Balisaus",
"Yu siang saus",
"Gon boa saus",
"Curry saus",
"Oestersaus",
"Zwarte pepersaus",
"Champignons",
"Chinese champignons",
"A la Maleisïe",
]
specials = [
"Nasi Kippenbolletjes Zoetzuur",
"Bami Kippenbolletjes Zoetzuur",
"Nasi Varkenbolletjes Zoetzuur",
"Bami Varkenbolletjes Zoetzuur",
"Nasi Babi Pangang",
"Bami Babi Pangang",
"Diverse Groenten met Bami",
"Diverse Groenten met Nasi",
]
2019-09-07 15:05:24 +02:00
def add() -> None:
2019-09-09 23:19:21 +02:00
"Add Ocean Garden to the database"
chinees = Location()
2019-09-05 03:33:29 +02:00
chinees.configure(
"Oceans's Garden",
"Zwijnaardsesteenweg 399 9000 Gent",
"tel: 09/222.72.74",
"http://oceangarden.byethost3.com/studentenmenus.html",
)
db.session.add(chinees)
2019-09-07 15:05:24 +02:00
def chinees_create_entry(name) -> None:
entry = Product()
entry.configure(chinees, name, 550)
db.session.add(entry)
2019-09-07 15:05:24 +02:00
def chinees_create_regulat(zetmeel, vlees="", saus="") -> None:
chinees_create_entry("{} {} {}".format(zetmeel, vlees, saus).rstrip())
for z, v, s in product(zetmelen, vlezen, sauzen):
chinees_create_regulat(z, v, s)
for special in specials:
2019-09-05 03:33:29 +02:00
chinees_create_entry(special)