11
question: How do i remove a .limit() that is already applied to a query object.
I have a Query which already has .limit(N) applied. Then i would like to remove the limit from the query, to have a .order_by applied. Order by has to be applied before any limit or offset.
example which fails:
query = session.query(Object).limit(10)
query = query.order_by(Object.field)
I tried doing:
query = session.query(Object).limit(10)
query = query.limit(None) # or False
query = query.order_by(Object.field)
But that does not work.
The reason i want this, is that the limit actually happens at another place as a sensible default limit.
Thanks