Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-persistent-filters

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-persistent-filters

Provide a django middleware that take care to persist the querystring in the browser cookies or in the Django Request object.

  • 1.0
  • PyPI
  • Socket score

Maintainers
1

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 or in the Django Request object.

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"
]

If you want to store filters in the Request object instead Cookies, add in the settings.py file:

PERSISTENT_FILTERS_IN_REQUEST = True

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>

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc