#2256: queryset.count() drops LIMIT/OFFSET information
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Type: defect | Status: new
Priority: normal | Milestone:
Component: Database wrapper | Version:
Severity: normal | Resolution:
Keywords: |
---------------------------------+------------------------------------------
Comment (by mtredinnick):
We should either be raising an error in these cases or behaving as we are
now.
Count() returns a single value and it doesn't make sense to apply limit
and offset to a singleton list like that (although it works. A non-zero
offset is going to lead to disappointment in the number of results you get
back, though). It's almost certainly not what the caller intended and it's
not going to work as a way to count how many things were returned after
the limit and offset are applied.
LIMIT/OFFSET are applied after the result set is determined (and in this
case it consists of one item, so it's pointless).
--
Ticket URL: <http://code.djangoproject.com/ticket/2256>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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/django-updates
-~----------~----~----~----~------~----~------~--~---