Michael Bayer wrote:
> 
> On Jan 13, 2008, at 1:02 PM, Alexandre Conrad wrote:
>>Anyway, my inital issue according to the subject's title, is that:
>>
>>  .filter(Catalog.c.id==CatalogChannel.c.id)
>>
>>generates the SQL query
>>
>>  "catalogs.id = catalogs.id"
>>
>>rather than the expected
>>
>>  "catalogs.id = catalog_channels.id"
>>
>>which
>>
>>  .filter(Catalog.c.id==catalog_channel_table.c.id)
>>
>>generates correctly when explcitly pointing the wanted table. Is  
>>that a
>>bug Mike ?
> 
> 
> i dont really think it is.  the "c" collection is deprecated anyway;

"c" is deprecated ? On the class or the table ? I haven't seen warning 
being printed in my console during execution.

> the "id" attribute on Catalog and all of its subclasses refers to the  
> base "id" column on the catalog table; the other "foreign key"  
> versions of that primary key are factored out when the mapper  
> compiles.  that the "id" gets shoved into "c" is an implementation  
> artifact, but is also why "c" is deprecated.  since the join youre  
> doing intends to break through the abstraction of the polymorphic  
> mapping, using the literal tables is the appropriate thing to do here,  
> barring the existence of a new feature that would make what you're  
> trying to do easier (which we should probably add).

Ahh, good to hear. It would feel more natural to me. We'd expect that 
CatalogChannel's table is catalog_channel_table, specially when we 
earlier set mapper(CatalogChannel, catalog_channel_table). Plus, using 
tables makes me have extra imports in my code, which I didn't need until 
now because I'm only using mapped classes.

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