On Jan 24, 2008, at 2:55 PM, Alexandre Conrad wrote:

> But these strings seem to be the relation names. And of course, my  
> Site
> object doesn't have a 'site_client' as SiteClient uses "inherits=Site"
> directly in the mapper(). So it's like "transparent" and there are no
> way to get a grab of that relation. Site neither has a 'playlists'
> relation, only SiteClient has.
>

as we've said, many times, its not appropriate for SQLAlchemy to  
*guess* which particular subclass might have the "site_client"  
attribute you're looking for.  if you would just set up "select_table"  
on your mapper, this whole issue goes away.

>
> .filter(Site.c.id==site_client_table.c.id)
>
> That join(['site', 'playlists', ('someprop', table.join(subtable)),
> MySubclass.someprop]) you've proposed feels ugly.

then set up "select_table".


> It'd be great to be able to join using with strings and be able to  
> grab
> the relation in-between inherited tables, like:
>
> Player.join(['site', 'site_client', 'playlists']).filter(...)

this is guessing.

> If 'site' doesn't have a 'site_client' relation(), check if we have a
> 'site_client' table as a fallback, and if we do, try to find the
> relation with it. Then figure out that the 'site_client' table is  
> mapped
> to SiteClient, and keep on finding the next relation 'playlists' to  
> join
> it with.

guessing, guessing, guessing.



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

Reply via email to