yeah... update to SVN 2124 and set up your mapper like this: mapper(Item, item_table, properties = dict(children = relation(Item, remote_side=[item_table.c.parent_uuid], backref=backref('parent', remote_side=[item_table.c.uuid])), ))
the "remote_side" argument will now be used to specify which side of the relation is "remote" for a self-referential mapper when you want to force a many-to-one relationship such as in the case of your "parent" backreference. for now, it also is needed for a join condition that contains no primary key columns. thats all you need to know going forward. now heres some things that you dont need to know: as to why you need the flag for a join that has no primary key columns, this is because the old logic, which continues to take effect if "remote_side" is not present, relies upon primary keys. the old logic cant rely upon the foreign keys because of the current documented usage of the "foreignkey" argument for self-referential tables. the docs say to use the "foreignkey" flag to force the "many-to-one" self-referential relationship; that usage will be deprecated in favor of the new "remote_side" argument which is dedicated to this purpose. "foreignkey" will now be used only for its primary purpose, which is to specify foreign key columns in the case that none are present on the table metadata. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---