Skip to content

SortableAdmin does not work with SimpleListFilter #264

@bmihelac

Description

@bmihelac

When model admin is subclass of SortableAdmin and SimpleListFilter is used FieldError exception is raised.
This is because SimpleListFilter defines parameter_name and SortableAdmin tries to filter by this field.

This is done in:
https://github.com/jazzband/django-admin-sortable/blob/master/adminsortable/admin.py#L56

Workaround is to override get_querystring_filters in SortableAdmin subclass and remove any parameter used in SimpleListFilter.

I have added minimal test case for this issue in https://github.com/bmihelac/django-admin-sortable/tree/tmp/issue-264-SimpleListFilter

To reproduce:

  1. run django devserver
  2. go to http://127.0.0.1:8000/admin/samples/category/
  3. select any value from filter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions