initial build

This commit is contained in:
2022-10-02 17:12:41 +02:00
parent ef8a139e71
commit d6467b2a8f
16 changed files with 632 additions and 0 deletions

46
models/utils.py Normal file
View File

@@ -0,0 +1,46 @@
from models.city import City
from models.database import Database
class DatabaseUtils:
@staticmethod
def init_city_data():
new_city = City(Database.connection, None, "Haastrecht")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Gouda")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Rotterdam")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Bruinisse")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Amsterdam")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Goes")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Zoetermeer")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Breda")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Eindhoven")
if not new_city.load_by_name():
new_city.save()
new_city = City(Database.connection, None, "Almere")
if not new_city.load_by_name():
new_city.save()