Example #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)
Example #2
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_'
Example #3
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')]
Example #4
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'),
        ]
Example #5
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'])]
Example #6
0
class Column(helo.Model):

    id = helo.Auto()
    name = helo.Char(length=100)
    create_at = helo.Timestamp(default=helo.ON_CREATE)