Skip to main content

Django isNull list_filter

https://badge.fury.io/py/django-isnull-list-filter.svg https://travis-ci.org/petrdlouhy/django-isnull-list-filter.svg?branch=master https://codecov.io/gh/petrdlouhy/django-isnull-list-filter/branch/master/graph/badge.svg

Simple list_filter that offers filtering by __isnull or by blank char field.

Documentation

The full documentation is at https://django-isnull-list-filter.readthedocs.io.

Quickstart

Install django-isnull-list-filter:

pip install django-isnull-list-filter

or use development version:

pip install -e git+https://github.com/PetrDlouhy/django-isnull-list-filter#egg=django-isnull-list-filter

Directly use it in your admin:

from isnull_filter import isnull_filter
  class MyAdmin(admin.ModelAdmin):
     list_filter = (
         isnull_filter('author'),  # Just set the field
         isnull_filter('author', _("Hasn't got author")),  # Or you can override the default filter title
         isnull_filter('author', _("Has got author"), negate=True),  # And you can negate the condition
     )

or:

from isnull_filter import isblank_filter
  class MyAdmin(admin.ModelAdmin):
     list_filter = (
         isblank_filter('author'),  # Just set the field
         isblank_filter('author', _("Hasn't got author")),  # Or you can override the default filter title
         isblank_filter('author', _("Has got author"), negate=True),  # And you can negate the condition
     )

Features

  • Can be used on:
    • simple field

    • ForeignKeyField

    • related ForeignKeyField

    • ManyToManyField

    • OneToOneField

  • Default title can be overriden

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Author:

  • Petr Dlouhý

Tools used in rendering this package:

History

0.3.2 (2021-12-16)

  • Fix for Django 4.0

0.3.1 (2021-11-18)

  • Fix isblank_filter

0.3.0 (2021-11-17)

  • Add also isblan_filter

0.1.0 (2017-04-26)

  • First release on PyPI.

Metadata

Release files for django-isnull-list-filter 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-isnull-list-filter 0.3.2
File Size Uploaded Provenance Actions
django-isnull-list-filter-0.3.2.tar.gz 18.3 kB Without provenance Details for django-isnull-list-filter-0.3.2.tar.gz

Release files / django-isnull-list-filter-0.3.2.tar.gz

Download URL django-isnull-list-filter-0.3.2.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44414d3ae7c694e9f20c5741a9931c105a9544371b68c6991a1e73b835e8cca8
BLAKE2b-256 checksum
How to use checksums
13a27e8dde977b9ac6588d944a2f8d928b5b87968649140c112e91a2c2a7f45e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.7

Security for django-isnull-list-filter 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page