#4293: The bug occur in a slice filter. |slice:"1::2" if query set is empty
----------------------------------------+-----------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Status: new | Component: Template system
Version: 0.96 | Resolution:
Keywords: loop state | Stage: Accepted
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------------------------+-----------------------------------
Changes (by Gary Wilson <[EMAIL PROTECTED]>):
* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0
Comment:
I have not confirmed this, but it appears that the slice filter code is
not catching AssertionError, which can be raised when an offset is
specified without a limit. From `django/db/models/query.py`:
{{{
#!python
# LIMIT and OFFSET clauses
if self._limit is not None:
sql.append("%s " % backend.get_limit_offset_sql(self._limit,
self._offset))
else:
assert self._offset is None, "'offset' is not allowed without
'limit'"
}}}
If this is indeed the case, then this ticket should be changed to make the
slice filter fail silently since there is already a ticket for slicing to
the end of a QuerySet (#2150).
--
Ticket URL: <http://code.djangoproject.com/ticket/4293#comment:1>
Django Code <http://code.djangoproject.com/>
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?hl=en
-~----------~----~----~----~------~----~------~--~---