Hi,
playing with inheritance, I figured out that an inherited mapped class
passed to filter doesn't point to the correct table.
I have 2 classes, Catalog and CatalogChannel(Catalog).
Here is the syntax followed by the generated query:
query.filter(Catalog.c.id==CatalogChannel.c.id)
WHERE catalogs.id = catalogs.id
The generated query should be "WHERE catalogs.id = catalog_channels.id".
I can make this happend by explicitly using the table itself rather than
the class:
query.filter(Catalog.c.id==catalog_channel_table.c.id)
WHERE catalogs.id = catalog_channels.id
Should I open a ticket for that ?
Normaly, I would join(["A", "B"]) the tables between each other. But if
a "channel" relation only exists on the CatalogChannel class,
join("channel") wouldn't work as SA looks at superclass Catalog. I
thought it would naturally find the relationship by looking at the
polymorphic "type" column from Catalog, but it doesn't. Mike suggested
we would need to extend the API with a new method like
join_to_subclass() or so... Even though, I still think SA should figure
out which relation I'm looking at...
Regards,
--
Alexandre CONRAD
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---