Skip to main content

Additional filters for django-admin.

Project description

Run tests for django-more-admin-filters coveralls badge python: 3.7, 3.8, 3.9, 3.10, 3.11 django: 2.2, 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 5.0, 5.1

Description

Django-more-admin-filters is a collection of django admin filters with a focus on filters using dropdown widgets, multiple choice filters and filters working with annotated attributes.

Installation

Install from pypi.org:

pip install django-more-admin-filters

Add more_admin_filters to your installed apps:

INSTALLED_APPS = [
    'more_admin_filters',
    ...
]

Use the filter classes with your ModelAdmin:

from more_admin_filters import MultiSelectDropdownFilter

class MyModelAdmin(admin.ModelAdmin):
    ...
    list_filter = [
        ('myfield', MultiSelectDropdownFilter),
        ...
    ]

Since the ModelAdmin routine to initialize the list filters doesn’t work with annotated attributes the usage for an annotation filter is a little bit special. The filter class needs to be equipped with the attribute’s name:

MyModelAdmin(admin.ModelAdmin):
list_filter = [
    BooleanAnnotationFilter.init('my_annotated_attribute'),
    ...
]

Filter classes

  • DropdownFilter

    Dropdown filter for all kind of fields.

  • ChoicesDropdownFilter

    Dropdown filter for fields using choices.

  • RelatedDropdownFilter

    Dropdown filter for relation fields.

  • RelatedOnlyDropdownFilter

    Dropdown filter for relation fields using limit_choices_to.

  • MultiSelectFilter

    Multi select filter for all kind of fields.

  • MultiSelectRelatedFilter

    Multi select filter for relation fields.

  • MultiSelectRelatedOnlyFilter

    Multi select filter for related fields with choices limited to the objects involved in that relation.

  • MultiSelectDropdownFilter

    Multi select dropdown filter for all kind of fields.

  • MultiSelectRelatedDropdownFilter

    Multi select dropdown filter for relation fields.

  • MultiSelectRelatedOnlyDropdownFilter

    Multi select dropdown filter for relation fields with choices limited to the objects involved in that relation.

  • BooleanAnnotationFilter

    Filter for annotated boolean-attributes.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_more_admin_filters-1.9.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

django_more_admin_filters-1.9-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file django_more_admin_filters-1.9.tar.gz.

File metadata

File hashes

Hashes for django_more_admin_filters-1.9.tar.gz
Algorithm Hash digest
SHA256 b51bee07576076b4e236720ebd713a91fe30310fe3a413c90000da4b0cdbe44f
MD5 af27390101df58a57637e4d445ba70d3
BLAKE2b-256 9ed10b5af990cf176dc86cd082189e0305d5730e74a5a5d5ce6a4f1641da782c

See more details on using hashes here.

File details

Details for the file django_more_admin_filters-1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for django_more_admin_filters-1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c30161089a05c0dba83b601b0b0b341bc8ea2614b59ff849d82cb3546c06db92
MD5 6c74812b6553c1c9fdc138452b446d7f
BLAKE2b-256 2b399de2c1cb7ee88725c1862b3e31020a8a4996e5e82dff15362d6766da06e3

See more details on using hashes here.

Supported by

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