Base(object):
def __tablename__(self):
return self.__name__.lower()
id = Column(Integer, primary_key=True)
time_Created = Column(TIMESTAMP, server_default=func.now())
time_Modified = Column(TIMESTAMP, server_default=func.now(), onupdate=func.current_timestamp())
class User(Base):
__tablename__ = 'user'
name = Column(String(50), unique=True)
email = Column(String(120), unique=True)
def __init__(self, name=None, email=None):
self.name = name
self.email = email
def __repr__(self):
return '<User %r>' % (self.name)
运行init_db()之后 我的Sqlite用户认为:
id || time_Create || time_Modified || name || email
所需的顺序:
id || name || email || time_Create || time_Modified
现在头疼,不知道如何实现这一点,需要一些建议
谢谢