not sure if that is the problem, but are Folder.items and FolterContent.folder the reciprocal ends of same relation? then u need only one of those, with backref.
On Tuesday 09 December 2008 12:08:02 Julien Cigar wrote: > Dear SQLAlchemy users, > > I'm playing with inheritance for a CMS-like application. It's very > usefull as it greatly simplifies the code. > > Here is my SQL script http://pastebin.com/f7c5297c8 and here is my > python code (mappers, etc) http://pastebin.com/f1e2738ba > (Not everything is shown...) > > As you can see, everything inherits from a "Content". "Folder" are > special "Content" which act as containers for one or more "Content" > through the "FolderContent" object (folder_content table). > > The problem is at line 128 of the second paste, SQLAlchemy is > unable to determine the join condition to the "Folder" ("folder" > table) which seems strange because folder_content table has > explicitely a foreign key to the "folder" table (line 70 of the > first paste). > > When I try to get a specific FolderContent through : > >>> model.FolderContent.query.get((12,6)) > > I get a: > > "ArgumentError: Could not determine join condition between > parent/child tables on relation FolderContent.folder. Specify a > 'primaryjoin' expression. If this is a many-to-many relation, > 'secondaryjoin' is needed as well." > > My question is: do I need to explicitely specify the join condition > when inheritance is involved ? Why is SQLAlchemy able to detect the > join condition for my "Content" (line 127) but not for my "Folder" > (line 128) ? > > In advance thanks for your answers > > Best regards, > Julien --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
