AssertionError is raised when I try to view a changelist with more than 100 items and some list_editable fields.
Django version: SVN-16714
Environment:
Request Method: GET
Request URL: ...
Django Version: 1.4 pre-alpha
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
'django.contrib.admin',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.markup',
'django.contrib.redirects',
'...',
'south']
Installed Middleware:
['django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_replicated.middleware.ReplicationMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.messages.middleware.MessageMiddleware']
Traceback:
File "/usr/lib/python2.6/dist-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.6/dist-packages/django/contrib/admin/options.py" in wrapper
326. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/views/decorators/cache.py" in _wrapped_view_func
88. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/contrib/admin/sites.py" in inner
192. return view(request, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapper
25. return bound_func(*args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py" in _wrapped_view
91. response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.6/dist-packages/django/utils/decorators.py" in bound_func
21. return func(self, *args2, **kwargs2)
File "/usr/lib/python2.6/dist-packages/django/contrib/admin/options.py" in changelist_view
1175. formset = cl.formset = FormSet(queryset=cl.result_list)
File "/usr/lib/python2.6/dist-packages/django/forms/models.py" in __init__
422. super(BaseModelFormSet, self).__init__(**defaults)
File "/usr/lib/python2.6/dist-packages/django/forms/formsets.py" in __init__
47. self._construct_forms()
File "/usr/lib/python2.6/dist-packages/django/forms/formsets.py" in _construct_forms
107. for i in xrange(self.total_form_count()):
File "/usr/lib/python2.6/dist-packages/django/forms/formsets.py" in total_form_count
83. initial_forms = self.initial_form_count()
File "/usr/lib/python2.6/dist-packages/django/forms/models.py" in initial_form_count
427. return len(self.get_queryset())
File "/usr/lib/python2.6/dist-packages/django/forms/models.py" in get_queryset
463. qs = qs.order_by(self.model._meta.pk.name)
File "/usr/lib/python2.6/dist-packages/django/db/models/query.py" in order_by
657. "Cannot reorder a query once a slice has been taken."
Exception Type: AssertionError at /admin/...
Exception Value: Cannot reorder a query once a slice has been taken.
minimal project with a test failing with the AssertionError. run ./manage.py test testapp