i have a few polymorphic tables, and i want to sort by a column in one of
the relationship.

i have tables a,b,c,d, with relationship a to b, b to c, c to d.

a to b is one-to-many b to c and c to d are one-to-one, but polymorphic.

given an item in table a, i will have a list of items b, c, d (all one to
one). how do i use sqlalchemy to sort them by a column in table d?

what i want is the sql statement:

select * from b
inner join c on b.c_key = c.b_key
inner join d on c.d_key = d.c_key
where b.a_key = ?
order by d.sort_key

in sqlalchemy.  it does not have to be on one query, as c and d are
polymorphic tables.  i have relationships on each of a, b, c, d. but as c
and d are polymorphic tables (on b), so i cannot hard code it.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to