Commit 249469c3 authored by sim's avatar sim

Add Node.related many-to-many relationship via nodes_nodes

parent 7b4dd6b4
......@@ -90,6 +90,11 @@ class Node(ValidatorMixin, Base):
# .filter(Node.title_abstract.match('keyword'))
title_abstract = Column(TSVectorType(regconfig='english'))
related = relationship('Node',
secondary='nodes_nodes',
primaryjoin='NodeNode.node1_id==Node.id',
secondaryjoin='NodeNode.node2_id==Node.id')
def __new__(cls, *args, **kwargs):
if cls is Node and kwargs.get('typename'):
typename = kwargs.pop('typename')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment