Login

Snippets by fx

Snippet List

Admin: return to change_list with filter and pagination applied

By default every time you change and save an object in the admin, the change_list "jumps" to the first page, so filters you used to find the object (or the pagination-page) have to be applied again. If you have to go through a multi-object-list step-by-step this could become really annoying. The above snippet changes this behaviour by returning to the referring URL when saving. Included in this URL are variables for the filters/pagination. The snippet is part of your custom Model.admin in admin.py.

  • filter
  • admin
  • pagination
  • change_list
Read More
Author: fx
  • 4
  • 8

fx has posted 1 snippet.