Use ORM for applicants
This commit is contained in:
13
lib/domain/ZipCode.py
Normal file
13
lib/domain/ZipCode.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from peewee import AutoField, CharField, ForeignKeyField
|
||||
|
||||
from lib.domain.BaseModel import BaseModel
|
||||
from lib.domain.Town import Town
|
||||
|
||||
|
||||
class ZipCode(BaseModel):
|
||||
class Meta:
|
||||
table_name = "postcode"
|
||||
|
||||
id = AutoField(column_name="postcodeid")
|
||||
zip_code = CharField(max_length=15, column_name="postcode")
|
||||
town = ForeignKeyField(Town, backref="zip_codes", column_name="addressid")
|
||||
Reference in New Issue
Block a user