On Jul 22, 2008, at 1:48 PM, Erez wrote:
> > So how would you solve it? > > I tried defining two foriegn keys: > class Link(Base): > __tablename__ = 'links' > > node_id = Column(Integer, ForeignKey('nodes.id')) > node_id2 = Column(Integer, ForeignKey('nodes.id')) > > id = Column(Integer, primary_key=True) > type = Column(String) > > fro = relation(Node, order_by=node_id, backref="links_out") > to = relation(Node, order_by=node_id2, backref="links_in") > > but got: > sqlalchemy.exc.ArgumentError: Could not determine join condition > between parent/ > child tables on relation Link.fro. Specify a 'primaryjoin' > expression. If this > is a many-to-many relation, 'secondaryjoin' is needed as well. > > Is a primaryjoin necessary then? yup > > I've tried to look-up the solution, but couldn't find any. here http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_customjoin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---