Liam Andrew (mailbackwards) gave a talk at #DjangoCon 2017 about ‘Supercharging the Django Admin’. Here is some of the information and a GitHub repo with a project demonstrating the information from the talk.
Ways to change the admin classes
- Add
list_displayto your Admin class to add more columns to the header field.
Define a method and then add that to the list_display to have arbitrary information, but remember to add prefetch_related to models you load in that method.
- Allow people to edit things from the admin list using `list_editable` but since this adds a button and a text field, it’s often overwhelming unless used for a specific purpose.
- Make dynamic actions using a method that returns a select box depending on what the user is attempting to do.
Useful Packages
- django-admin-row-actions : add a button/action at the end of each row for that individual item
- django-object-actions : Put buttons in the changelist without editing the template. Adds a
changelist_actionsto the admin models.
return redirect(‘admin:newshound_breed_changelist’) - django-nested-admin: Allows multiple layers in one view (breed group, breed, or dog) with sorting!
- django-inline-actions: another way to add action buttons to each row
Tips
Beware of over-querying without prefetch!
Repository with concrete examples
https://github.com/mailbackwards/newshound


You are testing things out and writing down notes on what works and what doesn’t. The things that do work, you copy down to a more formal recipe.
