Example #1
0
class Comment(Model):
    __table__ = 'comment'
    id = StringField(primary_key=True, default=next_id, ddl='varchar(50)')
    user_id = StringField(ddl='varchar(50)')
    blog_id = StringField(ddl='varchar(50)')
    user_name = StringField(ddl='varchar(50)')
    user_image = StringField(ddl='varchar(500)')
    content = TextField()
    created_at = FloatField(default=time.time)
Example #2
0
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__ = 's_user'
    # 设置字段对应的类型,字段名和类型需要和数据库中数据类型一致
    id = IntegerField(primary_key=True, default=None)
    s_username = StringField()
    s_pwd = StringField()
    s_gender = IntegerField()
    s_age = IntegerField()
Example #4
0
class User(Model):
    __table__ = 'users'

    id = StringField(primary_key=True,default=nextId(),ddl='varchar(50)')
    name = StringField(ddl='varchar(50)')
    password = StringField(ddl='varchar(50)')
    admin = IntegerField(default=0) #是否为管理员0-普通,1-admin
    email = StringField(ddl="varchar(50)")
    image = StringField(ddl="varchar(500)")
    created_at =FloatField(default=time.time)#创建时间
Example #5
0
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())
Example #6
0
class Comment(Model):
    __table__ = "comments"
    id = StringField(primary_key=True, default=next_id, ddl='varchar(50)')
    blog_id = StringField(ddl='varchar(50)')
    user_id = StringField(ddl='varchar(50)')
    user_name = StringField(ddl='varchar(50)')
    user_image = StringField(ddl='varchar(500)')
    content = TextField()
    created_at = FloatField(default=time.time)

    def __init__(self, **kw):
        super(Comment, self).__init__(**kw)
Example #7
0
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)
Example #8
0
class User(Model):
    __table__ = 'users'

    id = IntegetField(primary_key=True)
    name = StringField()

    user = yield from User.find('123')
Example #9
0
class Sale(Model):
    __table__ = 'sale'
    id = StringField(primary_key=True)
    no = StringField()
    customer_no = StringField()
    customer_name = StringField()
    goods_no = StringField()
    goods_name = StringField()
    goods_guige = StringField()
    goods_unit = StringField()
    quantity = FloatField()
    price = FloatField()
    money = FloatField()
    aprice_before = FloatField()
    aprice_after = FloatField()
    creater = StringField()
    creater_name = StringField()
    createtime = IntegerField()
class Comment(Model):
    __table__ = 'comments'

    id = IntegerField(primary_key=True, default=None)
    user_id = IntegerField()
    content = StringField()
    create_time = FloatField(default=time.time())


#!/usr/bin/env python3
# -*- coding: utf-8 -*-
Example #11
0
class Blog(Model):
    __table__ = 'blogs'

    id = StringField(primary_key=True, default=nextId(), ddl='varchar(50)')
    user_id = StringField(ddl='varchar(50)')
    user_name = StringField(ddl='varchar(50)')
    user_image = StringField(ddl="varchar(500)")
    content = StringField(ddl="varchar(700)")
    name = StringField(ddl="varchar(200)")
    summary = StringField(ddl="varchar(200)") #小结
    created_at = FloatField(default=time.time)  # 创建时间
Example #12
0
class Blog(Model):
    __table__ = 'blog'
    id = StringField(primary_key=True, default=next_id, ddl='varchar(50)')
    user_id = StringField(ddl='varchar(50)')
    user_name = StringField(ddl='varchar(50)')
    user_image = StringField(ddl='varchar(500)')
    title = StringField(ddl='varchar(50)')
    summary = StringField(ddl='varchar(200)')
    content = TextField()
    created_at = FloatField(default=time.time)
Example #13
0
class Goods(Model):
    __table__ = 'goods'
    id = StringField(primary_key=True)
    no = StringField()
    name = StringField()
    guige = StringField()
    unit = StringField()
    conversion = StringField()
    quantity = FloatField()
    aprice = FloatField()
    money = FloatField()
Example #14
0
class Taizhang(Model):
    __table__ = 'taizhang'
    id = StringField(primary_key=True)
    no = StringField()
    time = StringField()
    deal_no = StringField()
    goods_no = StringField()
    goods_name = StringField()
    goods_guige = StringField()
    buy_quantity = FloatField()
    buy_price = FloatField()
    buy_money = FloatField()
    sale_quantity = FloatField()
    sale_price = FloatField()
    sale_money = FloatField()
    store_quantity = FloatField()
    store_money = FloatField()
    store_aprice = FloatField()
    comment = StringField()
Example #15
0
class Blog(Model):
    __table__ = 'blogs'
    id = StringField(primary_key=True, default=next_id, ddl='varchar(50)')
    user_id = StringField(ddl='varchar(50)')
    user_name = StringField(ddl='varchar(50)')
    user_image = StringField(ddl='varchar(500)')
    name = StringField(ddl='varchar(50)')
    summary = StringField(ddl='varchar(200)')
    content = TextField()
    created_at = FloatField(default=time.time)

    def __init__(self, **kw):
        super(Blog, self).__init__(**kw)
Example #16
0
class User(Model):
    __table__ = 'user'
    id = IntegerField(primary_key=True)
    name = StringField()
    cnname = StringField()
    password = StringField(ddl='varchar(50)')
Example #17
0
class Customer(Model):
    __table__ = 'customer'
    id = StringField(primary_key=True)
    no = StringField()
    name = StringField()
    code = StringField()
    shuiwu = StringField()
    person = StringField()
    phone = StringField()
    mobile = StringField()
    address = StringField()
    email = StringField()
    bank = StringField()
    bank_no = StringField()
    postcode = StringField()
    fax = StringField()
    comment = StringField()
    creater = StringField()
    createtime = IntegerField()
Example #18
0
class User(Model):
    __table__ = 'user'

    id = IntegerField(primary_key=True)
    name = StringField()