Skip to main content

Collection of Django Admin filters

Project description

django-adminfilters

Collection of extra filters for the Django admin site

Pypi coverage Test Documentation Django Supported Python versions

https://user-images.githubusercontent.com/27282/153727131-d875f946-a8a8-4d89-be83-1d8cb5c9391a.mp4

Filters

  • Autocomplete
    • AutocompleteFilter
  • Simple
    • ValueFilter
  • Combobox
    • AllValuesComboFilter
    • RelatedFieldComboFilter
    • ChoicesFieldComboFilter
  • Dates
    • DateFilter
    • DateInDateRange
  • Radio
    • AllValuesRadioFilter
    • RelatedFieldRadioFilter
    • ChoicesFieldRadioFilter
    • BooleanRadioFilter
  • Checkbox
    • RelatedFieldCheckBoxFilter
  • Multiple
    • MultiValueFilter
  • ManyToMany
    • IntersectionFieldListFilter
    • UnionFieldListFilter
  • JSON
    • JsonFieldFilter
  • Number
    • NumberFilter
  • Special
    • QueryStringFilter
    • DjangoLookupFilter
    • PermissionPrefixFilter

FYI

Filters management (save/retrieve), is handled by an optional application adminfilters.depot that, due to the Django filters internal design, it uses GET method to save filter definition to the database. When you use FilterDepotManager to save a filter, the call is idempotent but not safe.

Usage examples

class MyModel(models.Model):
    index = models.CharField(max_length=255)
    name = models.CharField(max_length=255)
    age = models.IntegerField()
    flag = models.CharField(default="1", choices=(("0", "Flag 1"), ("1", "Flag 2"))
    household = models.ForeignKey("Household")
    custom = JSONField(default=dict, blank=True)


class MyModelAdmin(ModelAdmin):
    list_filter = (
        FilterDepotManager,  # needs `adminfilters.depot` app
        QueryStringFilter,
        DjangoLookupFilter,
        ("custom", JsonFieldFilter.factory(can_negate=False, options=True)),
        ("flag", ChoicesFieldComboFilter),
        ("household", AutoCompleteFilter)
        ("name", ValueFilter.factory(lookup="istartswith"),
        ("age", NumberFilter),
    )

Run demo app

git clone https://github.com/saxix/django-adminfilters.git
cd django-adminfilters
python3 -m venv .venv
source .venv/bin/activate
make develop
make demo

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

django_adminfilters-2.7.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_adminfilters-2.7-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file django_adminfilters-2.7.tar.gz.

File metadata

  • Download URL: django_adminfilters-2.7.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for django_adminfilters-2.7.tar.gz
Algorithm Hash digest
SHA256 0a825bc7cf7e067ecc5e90ff6968be4a14382c57e4d57f59a207928c8498f4f8
MD5 16088861b9a1bb3e2f6bf695a501012c
BLAKE2b-256 514ed3c553833c917f5b0e022da3fb96760d05d8aa9755a70c03cfaa9c641e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_adminfilters-2.7.tar.gz:

Publisher: release.yml on saxix/django-adminfilters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_adminfilters-2.7-py3-none-any.whl.

File metadata

File hashes

Hashes for django_adminfilters-2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c8323b6a6904ec7cf48faf40b4f61578e22210380953e050731de48211e74601
MD5 91aa4e732570e338fcac1058ea286e3f
BLAKE2b-256 8f1ea359d52ab2fcb8cf21ed1fa93cd663d66300b7948fc220c8a718beeb446c

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_adminfilters-2.7-py3-none-any.whl:

Publisher: release.yml on saxix/django-adminfilters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page