hi, how can put custom sql in a query? specifically in this code? the
problem is with the order_by. i want to pass it some custom sql:

        q = session.query(Student)
        sajoin = q.join_to('address')

        return q.select(
            sajoin,
            order_by="(ABS(address.lat - %s) + ABS(address.lon - %s))"
% (lat,lon)
            ,limit=800
        )



that doesnt work . this does:
    order_by=asc((address.c.lat - lat) + (address.c.lon - lon))

but it's not quite what i need--the manhattan distance....
and i'd like the results to be in my mapped objects so
i can still do
student.address.lat, etc.

i've scoured the docs, but maybe i've missed something.
any pointers?
thanks.
-brent

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