feat: faker data: query
This commit is contained in:
@@ -18,3 +18,6 @@ class City(db.Model):
|
||||
latitude = Column(String(255))
|
||||
longitude = Column(String(255))
|
||||
ad_code = Column(String(255))
|
||||
|
||||
def __to_dict__(self) -> dict:
|
||||
return {c.name: str(getattr(self, c.name)) for c in self.__table__.columns}
|
||||
|
||||
@@ -12,3 +12,6 @@ class Hotel(db.Model):
|
||||
identification = Column(String(18), server_default=text("''"), comment='入住者身份证号')
|
||||
in_data = Column(Date, nullable=False, comment='入住日期')
|
||||
out_data = Column(Date, nullable=False, comment='离开日期')
|
||||
|
||||
def __to_dict__(self) -> dict:
|
||||
return {c.name: str(getattr(self, c.name)) for c in self.__table__.columns}
|
||||
|
||||
@@ -11,3 +11,6 @@ class Railway(db.Model):
|
||||
phone = Column(String(20), nullable=False, server_default=text("''"), comment='手机号码')
|
||||
train = Column(String(10), nullable=False, server_default=text("''"), comment='车次')
|
||||
launch = Column(Date, nullable=False, comment='发车时间')
|
||||
|
||||
def __to_dict__(self) -> dict:
|
||||
return {c.name: str(getattr(self, c.name)) for c in self.__table__.columns}
|
||||
|
||||
Reference in New Issue
Block a user