46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
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, "Delft")
|
|
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() |