Пример #1
0
class OneUser(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String)

    roles = db.relationship('OneRole', back_populates='user')
Пример #2
0
class OneRelationship(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String)
    backrefs = db.relationship('OneBackref',
                               backref=db.backref('relationship'))
Пример #3
0
class OneRole(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String)

    user_id = db.foreign_key('OneUser')
    user = db.relationship('OneUser', back_populates='roles')
Пример #4
0
class TwoBasic(db.Model):
    app = db.Column(db.String)
Пример #5
0
class OneBackref(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String)
    relationship_id = db.foreign_key('OneRelationship')
Пример #6
0
class TwoBasic(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String, index=True)
Пример #7
0
class OneBasic(BaseOneBasic):
    class Meta:
        lazy_mapped = True

    ext = db.Column(db.String)
Пример #8
0
class OneParent(db.Model):
    class Meta:
        lazy_mapped = True

    name = db.Column(db.String)