allen.fowler wrote: > > >> I tried: >> >> children = relation("Node", backref=backref("parent", >> remote_side="nodes.id")) >> > > got it to work with: > > remote_side=[id] > > But: > > 1) Why is remote_side a list?
in this case you could just say remote_side=id. its optionally a list if multiple columns occur on the "remote side" of the join condition (i.e. as in a composite primary key). > 2) Where does single_parent fit in to this? single_parent is a flag that gets suggested to you if you attempt to use "delete-orphan" cascade with a many-to-one or many-to-many foreign key combination (meaning they are essentially distilled into "one-to-one" or "one-to-many"). it's basically requiring you to sign the agreement "I promise not to connect this object to more than one parent of this type so that delete-orphan does what's advertised". if it hasn't been suggested to you, there's no need to use it (unless you want to enforce that contract otherwise). --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---