Django-NumericFieldListFilter is a plugin for Django. It allows easy filtering of numeric fields (IntegerField, FloatField and DecimalField) inside the Django admin.
For each numeric field, two inputs will be added to the admin, representing a minimum and maximum value which you can filter on.
$ pip install django-numericfieldlistfilter
You'll need Django version 1.8 or greater.
-
Add
djangonumericfieldlistfilter
to the installed apps:INSTALLED_APPS = ( ... 'djangonumericfieldlistfilter', ... )
-
Use the
NumericModelAdmin
as the base class of your admin classes:from djangonumericfieldlistfilter.options import NumericModelAdmin class TransactionAdmin(NumericModelAdmin): ...
-
Add your numeric field to the list_filter variable:
list_filter = ( ... 'price_paid' ... )
0.1
MIT