class User(Model): __table__ = 'user' id = StringField(primary_key=True, default=next_id, ddl='varchar(50)') email = StringField(ddl='varchar(50)') password = StringField(ddl='varchar(50)') admim = BooleanField() name = StringField(ddl='varchar(50)') image = StringField(ddl='varchar(500)') created_at = FloatField(default=time.time)
class User(Model): __table__ = 'users' id = StringField(dll='varchar(50)', primary_key=True, default=next_id) email = StringField(dll='varchar(50)') passwd = StringField(dll='varchar(50)') admin = BooleanField() name = StringField(dll='varchar(50)') image = StringField(dll='varchar(500)') created_at = FloatField(default=time.time())
class User(Model): __table__ = 'users' # id is primary_key # default is used to save ids, next_id will be called if call insert id = StringField(primary_key=True, default=next_id, ddl='varchar(50)') email = StringField(ddl='varchar(50)') passwd = StringField(ddl='varchar(50)') admin = BooleanField() # default value is false name = StringField(ddl='varchar(50)') image = StringField(ddl='varchar(500)') created_at = FloatField(default=time.time) def __init__(self, **kw): super(User, self).__init__(**kw)