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()

is CatalogChannel.channel a self referential relation to another  
Channel ?   the classes you use in filter() are usually of the type  
that "channel" would be here.

>
>
> generates:
>
> SELECT files.id AS files_id, medias.id AS medias_id, files.name AS
> files_name, files.mime AS files_mime, files.date AS files_date,
> files.size AS files_size, files.checksum AS files_checksum,
> files.description AS files_description, files.type AS files_type,
> medias.id_catalog AS medias_id_catalog
> FROM catalog_channels, files INNER JOIN medias ON files.id = medias.id
> INNER JOIN catalogs ON catalogs.id = medias.id_catalog INNER JOIN
> channels ON channels.id = catalog_channels.id_channel
> WHERE catalog_channels.id_channel = %s ORDER BY files.name
>
> which returns, with MySQL:
>
> 1054, "Unknown column 'catalog_channels.id_channel' in 'on clause'"

also the actual error here is a known MySQL 5 issue, but the SQL is  
still not what SQLAlchemy would want to produce.


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