feat: faker data: query

This commit is contained in:
Zhaolong
2022-02-07 16:28:14 +08:00
parent a9c08e3257
commit 5f56feffb2
6 changed files with 81 additions and 20 deletions

View File

@@ -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}