Hi Glauco On 9/27/07, Glauco <[EMAIL PROTECTED]> wrote: > > Hi all, > how can i know the correct name of a table compiled into qry that SA > has automatically aliased? > > for example: > a join b join c join d.. > > sqlalchemy has created something like > > select blabla > from a AS anon_b406 > join..... > > > when i try to put into an "order by a" > obviously the qry goes wrong. > > invalid reference to FROM-clause entry for table "a"
Does your question has any relation with the patch that allows ordering or related objects's attributes ? ;) If so, I think I know what you are doing wrong... you must use Query's .join() or .outerjoin() method. Like that: session.query(ObjectA).join('property_b').order_by(ObjectB.c.foobar) Where 'foobar' maps to the column from B table which you want to use to sort your data... > Thank's > Glauco HTH.. Roger --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---