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)
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')
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)
class Test: field1 = orm.PrimaryKey(mock.Mock) field2 = orm.PrimaryKey(mock.Mock) field3 = orm.Column(mock.Mock)
class Test: field1 = orm.PrimaryKey(mock.Mock)
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')
class Table: id = orm.PrimaryKey(orm.Integer) name = orm.Column(orm.String) _password = orm.Column('password', orm.String)