Esempio n. 1
0
class Comment(Model):
    __table__ = 'comments'

    id = IntegerField(primary_key=True, default=None)
    user_id = IntegerField()
    content = StringField()
    create_time = FloatField(default=time.time())
Esempio n. 2
0
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()
Esempio n. 3
0
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)')
Esempio n. 4
0
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()  #是否有任务
Esempio n. 5
0
class User(Model):
    __table__ = 'users'

    id = IntegerField(primary_Key=True)
    name = StringField()
Esempio n. 6
0
 class User(Model):
     id = IntegerField('id', primary_key=True)
     name = StringField('username')
Esempio n. 7
0
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)')