On Apr 27, 2007, at 11:17 AM, Dave Harrison wrote:

>
> Hi all,
>
> I've got a situation where I have a table of data that is common,  
> with the
> subtables just adding an extra couple of fields.  Using multiple  
> inheritance I
> fit it together as below (pretty much the same as the documented  
> example).
>
> What I'm having problems with is then accessing those child tables  
> as properties
> of the person table mapping.  I'm get the following error,
>
> """
> Cant determine relation direction for 'example' on mapper 'Mapper| 
> Person|person'
> with primary join 'person.id = example.person_id' - foreign key  
> columns are not
> present in neither the parent nor the child's mapped
> tablesset([Column('person_id',Integer(),ForeignKey('person.id'))])
> """
>
>

the surprise here is that you established the relationship to the  
subclass, when the join condition is expressed in the superclass'  
table.  theres all kinds of logic that is "limiting" the search for  
joins and foreign key relationships to between just the "local"  
tables (i.e. not to the joined inherited/inheriting tables) since we  
have a lot of test cases with very intricate self-referential  
relationships that blow up easily.  so this innocent example led to  
the need to make all those searches look in both places separately  
and pick the one that fits better.  this is in r2564.

> P.S that error should read "foreign key columns are present in  
> neither ..."

also in r2564.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to