On Aug 21, 2010, at 5:16 PM, Michael Hipp wrote: > I'm trying to do exactly what is described here: > > http://www.sqlalchemy.org/docs/mappers.html#adjacency-list-relationships > > But I'm using declarative. Here's what I have but it fails with the exception > below: > > class Option(Base): > __tablename__ = 'options' > id_ = Column(Integer, primary_key=True) > parent_id = Column(Integer, ForeignKey('options.id_')) > parent = relationship('Option', > backref=backref('children', order_by=name, > remote_side=['options.c.id_'])) > > sqlalchemy.exc.ArgumentError: Relationship Option.children could not > determine any local/remote column pairs from remote side argument set > > How do I make this work with declarative?
If you were to use string literals with remote_side here, its the full expression would be a string, i.e. remote_side="Option.id_". But that's not needed here since id_ as a Column is right there, so remote_side=id_ . > > Thanks, > Michael > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To post to this group, send email to sqlalch...@googlegroups.com. > To unsubscribe from this group, send email to > sqlalchemy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sqlalchemy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.