On Jan 14, 2008, at 12:04 PM, Michael Bayer wrote:

>
>
> On Jan 14, 2008, at 11:59 AM, Michael Bayer wrote:
>
>>
>>
>> On Jan 14, 2008, at 10:44 AM, Alexandre Conrad wrote:
>>
>>>
>>> model.Media.query.join(["catalog",
>>> model
>>> .CatalogChannel
>>> .channel
>>> ]).filter
>>> (model.CatalogChannel.c.id_channel==c.playlist.id_channel).all()
>>>
>>
>> like, are you sure you dont want to just say:
>>
>> model
>> .Media
>> .query
>> .join
>> (["catalog
>> "]).filter
>> (model.CatalogChannel.c.id_channel==c.playlist.id_channel).all()
>>
>> ?  that is if you want the Media which contains a CatalogChannel with
>> a certain id_channel.   otherwise im still having trouble wrapping my
>> head around what youre trying to do there.
>
>
> oh also, this might be complicating things....the above query I just
> gave you will only work at the moment if you are using select_table on
> your Catalog mapper to define a polymorphic join.  Its possible that
> you could define select_table and just go with the above, simpler
> query (if my particular guess here is correct as to what youre trying
> to accomplish).

or if not using select_table, force it manually like this:

session
.query
(Media
).select_from
(files
.join
(media
).join
(catalog).join(catalog_channel)).filter(CatalogChannel.id_channel==foo)




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