class Comment(Model): __table__ = 'comments' id = IntegerField(primary_key=True, default=None) user_id = IntegerField() content = StringField() create_time = FloatField(default=time.time())
class User(Model): # 定义表名,要和数据库表名一致 __table__ = 'blog_user' # 设置字段对应的类型,字段名和类型需要和数据库中数据类型一致 id = IntegerField(primary_key=True, default=None) s_username = StringField() s_pwd = StringField() s_gender = IntegerField() s_age = IntegerField()
class User(Model): __table__ = 'user' id = IntegerField(primary_key=True, auto_increment=True) # id = StringField(primary_key=True, ddl='varchar(50)') email = StringField(ddl='varchar(50)') passwd = StringField(ddl='varchar(50)') perLevel = IntegerField() #账号级别 perPasswd = StringField(ddl='varchar(50)') name = StringField(ddl='varchar(50)')
class Device(Model): __table__ = 'device' id = IntegerField(primary_key=True, auto_increment=True) name = StringField(ddl='varchar(50)') kind = IntegerField() status = IntegerField() perLevel = IntegerField() time = LongField() week = StringField() port = IntegerField() task = IntegerField() schedule = IntegerField() #是否有任务
class User(Model): __table__ = 'users' id = IntegerField(primary_Key=True) name = StringField()
class User(Model): id = IntegerField('id', primary_key=True) name = StringField('username')
class Runoob(Model): __table__ = 'runoob_tb1' runoob_id = IntegerField(primary_key=True) runoob_title = StringField(ddl='varchar(100)') runoob_author = StringField(ddl='varchar(40)') submission_date = StringField(ddl='varchar(20)')