> > hi.
> > i have the case of polymorphic mapper referencing itself (or
> > other of it's sub-class objects), and i want to query/filter on a
> > value of the referenced object.
> > e.g. all people who have friends of age > 25.
>
> these are highly highly complex queries and im not sure if the
> Query SQL compiler is really appropriate for this; you probably
> want to go with rolling your own select statements for this.  that
> or perform separate queries for each subclass and then combine the
> results in Python (this might be something SA does automatically in
> the future, as its the only way Hibernate does polymorphic loads).

hmmm. 
i have a product of 2 polymorphisms combined here.
If impossible to do as 1 query, i could split one of them into 
separate simpler selects, and have for each a polymorphic union 
against a table (or table.join.select), but this won't work either 
(case 3). 

The query itself, if fixed manualy, works: 
SELECT ...
FROM (...) as pu_human, human as humanalias
WHERE pu_human.friend_id = humanalias.db_id AND humanalias.age > ? 

while the SA does:
SELECT ...
FROM (...) as pu_human
WHERE pu_human.friend_id = pu_human.db_id AND pu_human.age > ? 

is it some .corresponding_column() taking ownership of too many 
things?

btw; i think i tried the other way, e.g. table against 
polymorhic_union, that produced right FROMs but still wrong WHERE..

svil

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