Integrates django-admin-rangefilter into Wagtail's ModelAdmin
- Python 3.9, 3.10, 3.11, 3.12, 3.13
- Django 4.2, 5.0, 5.1
- Wagtail 5.2, 6.0, 6.1, 6.2, 6.3 (with external package wagtail-modeladmin)
NOTE: Starting with wagtail 5.0 you can install and use the external package wagtail-modeladmin, with 6.0+ you have to use it.
pip install wagtail-rangefilter
Add this to your installed django applications:
INSTALLED_APPS = [
...,
'wagtail_rangefilter',
'rangefilter',
...,
]
from wagtail_modeladmin.options import ModelAdmin
from wagtail_rangefilter.filters import DateRangeFilter, DateTimeRangeFilter
class ExampleAdmin(ModelAdmin):
...
list_filter = (("test_date", DateRangeFilter), ("test_datetime", DateTimeRangeFilter),)
...
pip install -e '.[testing]' -U
tox -e interactive
Alternative:
cp tests/local.py.example tests/local.py
python manage.py runserver