Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#17729 closed Bug (duplicate)

regression in django-admin: list_editable doesn't work when pagination

Reported by: Velmont Owned by: nobody
Component: contrib.admin Version: 1.4-alpha-1
Severity: Release blocker Keywords: regression
Cc: odin.omdal@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Given the following code:

from django.db import models

class Member(models.Model):
    name = models.CharField(max_length=200, unique=True)

from django.contrib import admin

class MemberAdmin(admin.ModelAdmin):
    list_display = ('pk', 'name')
    list_editable = ('name',)
    list_per_page = 2, MemberAdmin)

And add 3 items (so that it paginates, you could also add 101 objects in standard conf if that floats your boat).

Et voilá:

AssertionError: Cannot reorder a query once a slice has been taken.


Request Method: GET
Request URL:

Django Version: 1.4b1
Python Version: 2.7.2
Installed Applications:
Installed Middleware:

File "/home/odin/tmp/django-list_editable/env/src/django/django/core/handlers/" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/contrib/admin/" in wrapper
  368.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/utils/" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/views/decorators/" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/contrib/admin/" in inner
  196.             return view(request, *args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/utils/" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/utils/" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/odin/tmp/django-list_editable/env/src/django/django/utils/" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/home/odin/tmp/django-list_editable/env/src/django/django/contrib/admin/" in changelist_view
  1215.             formset = cl.formset = FormSet(queryset=cl.result_list)
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in __init__
  424.         super(BaseModelFormSet, self).__init__(**defaults)
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in __init__
  50.         self._construct_forms()
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in _construct_forms
  114.         for i in xrange(self.total_form_count()):
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in total_form_count
  90.             initial_forms = self.initial_form_count()
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in initial_form_count
  429.             return len(self.get_queryset())
File "/home/odin/tmp/django-list_editable/env/src/django/django/forms/" in get_queryset
  471.                 qs = qs.order_by(
File "/home/odin/tmp/django-list_editable/env/src/django/django/db/models/" in order_by
  753.                 "Cannot reorder a query once a slice has been taken."

Exception Type: AssertionError at /admin/mytestapp/member/
Exception Value: Cannot reorder a query once a slice has been taken.

Attachments (1)

django-list_editable.tgz (8.8 KB) - added by Velmont 8 years ago.
small test project

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Velmont

Attachment: django-list_editable.tgz added

small test project

comment:1 Changed 8 years ago by Odin Hørthe Omdal

Cc: odin.omdal@… added

comment:2 Changed 8 years ago by Carl Meyer

Triage Stage: UnreviewedAccepted

Confirmed that this bug is present in trunk, and not in 1.3.X, which makes it a regression and a release blocker. Thanks for the report!

comment:3 Changed 8 years ago by anonymous

Resolution: duplicate
Status: newclosed

This was actually already reported in #16819.

comment:4 Changed 8 years ago by Julien Phalip

Oops, that was me.

Note: See TracTickets for help on using tickets.
Back to Top