Use ORM for applicants
This commit is contained in:
12
lib/domain/Town.py
Normal file
12
lib/domain/Town.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from peewee import AutoField, CharField, ForeignKeyField
|
||||
|
||||
from lib.domain.BaseModel import BaseModel
|
||||
from lib.domain.Country import Country
|
||||
|
||||
|
||||
class Town(BaseModel):
|
||||
class Meta:
|
||||
table_name = "address"
|
||||
id = AutoField(column_name="addressid")
|
||||
town = CharField(max_length=50, column_name="city")
|
||||
country = ForeignKeyField(Country, column_name="countryid", backref="towns")
|
||||
Reference in New Issue
Block a user