fix: Add foreign_keys to User.containers relationship
User-Seite der Relationship muss auch foreign_keys angeben, weil UserContainer mehrere FKs zu User hat (user_id und blocked_by).
This commit is contained in:
parent
f7cd391894
commit
f58f6d45e8
|
|
@ -38,7 +38,7 @@ class User(UserMixin, db.Model):
|
||||||
blocker = db.relationship('User', remote_side=[id], foreign_keys=[blocked_by])
|
blocker = db.relationship('User', remote_side=[id], foreign_keys=[blocked_by])
|
||||||
|
|
||||||
# Multi-Container Support
|
# Multi-Container Support
|
||||||
containers = db.relationship('UserContainer', back_populates='user', cascade='all, delete-orphan')
|
containers = db.relationship('UserContainer', foreign_keys='UserContainer.user_id', back_populates='user', cascade='all, delete-orphan')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def container_id(self):
|
def container_id(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user