Provide a django middleware that take care to persist the querystring in the browser cookies.
Project description
Django Persistent Filters
Django Persistent Filters is a Python package which provide a django middleware that take care to persist the querystring in the browser cookies.
If you have a ListView with a Form for filter the objects, this package is perfect for you!
Installation
Use the package manager pip to install:
pip install django-persistent-filters
Usage
Put the middleware in the settings.py
file:
MIDDLEWARE = [
...,
"persistent_filters.middleware.PersistentFiltersMiddleware"
]
Add the urls with a filter form in settings.py
file:
PERSISTENT_FILTERS_URLS = [
# You can use name urls
reverse_lazy("user:list"),
# or you can write the path without domain
"/user/list"
]
Add in the form the button for reset filters:
<button type="submit" name="reset-filters">Reset</button>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-persistent-filters-0.21.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb95d8fd3630a67aa4b9f271e142f5454b9ae26dab2b0afd88e0f939a9d67610 |
|
MD5 | 71ed725b8349a53616c1a9169c324071 |
|
BLAKE2b-256 | 331d4c301983a29dc3712687d658b757a9312472869b4e496f6e1a2c97ab4478 |
Close
Hashes for django_persistent_filters-0.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee4f6bf779e617f1a509a2536947a8b6e7f726f62041b0d8a9a29d72295af6af |
|
MD5 | 4ca2a7e6d0fea7f2dad41e9755a540a4 |
|
BLAKE2b-256 | ca81956cb0ceb2559acdffb0f0412cdd41022093b8ddded2dac9eac3705d3977 |