On Mar 1, 12:44 pm, svilen <[EMAIL PROTECTED]> wrote:
> 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).
>
> btw. in the polymorphic_union(), is that forced aliasing on any
> select() entries really needed?
yes. aliasing serves the purpose of ensuring that all column names
are unique (which for these queries is essential), and also sqlite
requires aliases on all columns in a subquery when selecting from that
subquery.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---