【发布时间】:2012-01-06 19:35:26
【问题描述】:
class Posts(Base):
__tablename__ = 'posts_posts'
id = Column(Integer, primary_key = True)
user_id = Column(Integer, nullable=False)
body = Column(Text, nullable=True)
created_at = Column(Date) << is this right?
updated_at = Column(Date) ??
我还希望created_at 列自动设置创建日期。
此外,updated_at 列用于在此行更改时设置日期。
【问题讨论】:
标签: mysql database date orm sqlalchemy