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")