Fix the link between objects and subjects.
This commit is contained in:
parent
f9b510a967
commit
51bca111c2
|
@ -140,13 +140,15 @@ class Item(TimeStampedModel):
|
||||||
text = Column(UnicodeText)
|
text = Column(UnicodeText)
|
||||||
|
|
||||||
subjects = relationship('Item',
|
subjects = relationship('Item',
|
||||||
|
lazy='dynamic',
|
||||||
secondary='reference',
|
secondary='reference',
|
||||||
backref='object_item',
|
primaryjoin=id == Reference.object_id,
|
||||||
foreign_keys=Reference.subject_id)
|
secondaryjoin=id == Reference.subject_id)
|
||||||
objects = relationship('Item',
|
objects = relationship('Item',
|
||||||
|
lazy='dynamic',
|
||||||
secondary='reference',
|
secondary='reference',
|
||||||
backref='subject_item',
|
primaryjoin=id == Reference.subject_id,
|
||||||
foreign_keys=Reference.object_id)
|
secondaryjoin=id == Reference.object_id)
|
||||||
user = relationship('User', backref='items')
|
user = relationship('User', backref='items')
|
||||||
|
|
||||||
__mapper_args__ = {
|
__mapper_args__ = {
|
||||||
|
|
Loading…
Reference in a new issue