I just tried limiting a query to the final 10 items of a 30010 item
table using this slice notation:
  q = some.Session.query()
  items = q[-10:]
the resulting mysql query had no limit or offset clause. Changing the
form to
  items = q[q.count()-10:]
produced:
  select from data LIMIT 30000, 18446744073709551615
(which worked fine in practice). Changing the form to
  items = q[q.count()-10:q.count()]
produced the desired:
  select from data LIMIT 30000, 10

Is that the expected behavior for negative indices?
I am using SA 0.5.4p2
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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