Esempio n. 1
0
class Preference(Table):

    id = orm.PrimaryKey(orm.Integer, autoincrement=True)
    created_at = orm.Column(orm.Timestamp, default=orm.utc_now())
    key = orm.Column(orm.String, length=50)
    type = orm.Column(orm.String, length=50)
    default = orm.Column(orm.Text)
Esempio n. 2
0
class UserPreference(Table):

    id = orm.PrimaryKey(orm.Integer, autoincrement=True)
    created_at = orm.Column(orm.Timestamp, default=orm.utc_now())
    user_id = orm.ForeignKey(User.id)
    preference_id = orm.ForeignKey(Preference.id)
    value = orm.Column(orm.Text)

    preference = orm.OneToOne(preference_id)
    user = orm.OneToOne('user_preference.user_id')
Esempio n. 3
0
class User(Table):

    id = orm.PrimaryKey(orm.Integer, autoincrement=True)
    created_at = orm.Column(orm.Timestamp, default=orm.utc_now())
    login = orm.Column(orm.String, length=50, unique=True)
    password = orm.Column(orm.String, length=60)
    firstname = orm.Column(orm.String, length=255, nullable=True)
    lastname = orm.Column(orm.String, length=255, nullable=True)
    email = orm.Column(orm.String, length=255, unique=True)
    lang = orm.Column(orm.String, length=2)
    preferences = orm.OneToMany('user_preference.user_id')
    groups = orm.ManyToMany(Group, UserGroup)
Esempio n. 4
0
 class Test:
     field1 = orm.PrimaryKey(mock.Mock)
     field2 = orm.PrimaryKey(mock.Mock)
     field3 = orm.Column(mock.Mock)
Esempio n. 5
0
 class Test:
     field1 = orm.PrimaryKey(mock.Mock)
Esempio n. 6
0
class Group(Table):

    id = orm.PrimaryKey(orm.Integer, autoincrement=True)
    created_at = orm.Column(orm.Timestamp, default=orm.utc_now())
    name = orm.Column(orm.String, length=255)
    users = orm.ManyToMany('user', 'user_group')
Esempio n. 7
0
 class Table:
     id = orm.PrimaryKey(orm.Integer)
     name = orm.Column(orm.String)
     _password = orm.Column('password', orm.String)