Esempio n. 1
0
class Author(helo.Model):

    id = helo.Auto()
    name = helo.VarChar(length=45, comment='username')
    password = helo.VarChar(length=100)
    create_at = helo.Timestamp(default=helo.ON_CREATE)
    update_at = helo.Timestamp(default=helo.ON_UPDATE)
Esempio n. 2
0
class User(People):

    nickname = helo.VarChar(length=100)
    password = helo.VarChar(name='pwd')
    role = helo.Int(default=0)
    lastlogin = helo.DateTime(default=datetime.datetime.now, name='loginat')

    class Meta:
        db = 'helo'
        name = 'user_'
        indexes = (
            helo.K('idx_name', 'name'),
            helo.UK('unidx_nickname', 'nickname')
        )
Esempio n. 3
0
class User(Person):
    email = helo.Email(default='')
    password = helo.VarChar(length=100, null=False)
    create_at = helo.Timestamp(default=helo.ON_CREATE)

    class Meta:
        indexes = [helo.K('idx_ep', ['email', 'password'])]
Esempio n. 4
0
class Employee(People):

    salary = helo.Float()
    departmentid = helo.Int()
    phone = helo.VarChar(default='')
    email = helo.Email(length=100, default='')

    class Meta:
        indexes = [helo.K('idx_age_salary', ['age', 'salary'])]
Esempio n. 5
0
class Role(helo.Model):

    id = helo.Int(primary_key=True, auto=True)
    name = helo.VarChar(length=50)
    is_deleted = helo.Bool(default=False)
    create_at = helo.Timestamp(default=helo.ON_CREATE)
    update_at = helo.Timestamp(default=helo.ON_UPDATE)

    class Meta:
        name = 'role_'
Esempio n. 6
0
class People(helo.Model):

    id = helo.Auto()
    name = helo.VarChar(length=45)
    gender = helo.Tinyint(length=1, unsigned=True)
    age = helo.Tinyint(unsigned=True)
    create_at = helo.Timestamp(default=helo.ON_CREATE)
    update_at = helo.Timestamp(default=helo.ON_UPDATE)

    class Meta:
        indexes = [helo.K('idx_name', 'name')]
Esempio n. 7
0
class Post(helo.Model):

    id = helo.Int(primary_key=True, auto=True)
    name = helo.VarChar(length=100)
    author = helo.Int(default=0)
    column = helo.Int(default=0)
    is_deleted = helo.Tinyint(default=0)
    created = helo.DateTime(default=datetime.datetime(2019, 10, 10))

    def __repr__(self):
        return '<{} {}>'.format(self.__class__.__name__, self.name)
Esempio n. 8
0
class Post(helo.Model):
    id = helo.Auto(comment='auto increment pk')
    title = helo.VarChar(length=100)
    content = helo.Text(encoding=helo.ENCODING.UTF8MB4)
    author = helo.Int(default=0)
    create_at = helo.Timestamp(default=helo.ON_CREATE)
    update_at = helo.Timestamp(default=helo.ON_UPDATE)

    class Meta:
        indexes = [
            helo.K('idx_title', 'title'),
            helo.K('idx_author', 'author'),
        ]
Esempio n. 9
0
class Author(helo.Model):
    id = helo.BigAuto()
    name = helo.VarChar(length=45, null=False)
    email = helo.Email(default='')
    password = helo.VarChar(length=100, null=False)
Esempio n. 10
0
class Person(helo.Model):
    id = helo.BigAuto()
    name = helo.VarChar(length=45, null=False)