Closed yetone closed 11 years ago
What are the steps to reproduce this error?
On May 25, 2013, at 7:31 AM, yetone notifications@github.com wrote:
AttributeError: 'Query' object has no attribute 'orderby'
— Reply to this email directly or view it on GitHub.
This is a typo in documentation. Correct method name is order_by()
but order_by method can not use lambda
order_by method have full support for lambda:
>>> from pony.orm.examples.estore import *
>>> select(c for c in Customer).order_by(lambda c: sum(c.orders.total_price))[:]
SELECT "c"."id"
FROM "Customer" "c"
LEFT JOIN "Order" "order-1"
ON "c"."id" = "order-1"."customer"
GROUP BY "c"."id"
ORDER BY coalesce(SUM("order-1"."total_price"), 0)
If something doesn't work for you, please send query example which produces an error.
thank u very much!!!
The documentation at http://doc.ponyorm.com/ was updated.
AttributeError: 'Query' object has no attribute 'orderby'