[sqlalchemy] Re: How to specify the remote side in a self-referential relationship on one column only?

2011-01-06 Thread Daniel Gerber
      Node(id='node2_'), >     ] > ) > > n1, n2 = s.query(Node).\ >             options(eagerload(Node.children)).\ >             filter(Node.id.in_(['node1', 'node2'])).\ >             all() > > assert [n.id for n in n1.children] == ['node1_'

[sqlalchemy] How to specify the remote side in a self-referential relationship on one column only?

2011-01-05 Thread Daniel Gerber
Hi sqlalchemy-group, Is it possible to define a self-referential relationship on a join condition involving the same column on both sides? This: class Node(Base): __tablename__ = 'nodes' id = Column(String(8), primary_key=True) Node2 = aliased(Node) Node.children = relationship(Node2,