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.
 
 
Go to file
Thomas Leichtfuß c879cac38e little code cleanup - added some newlines at the end of the file 2021-07-16 12:19:30 +02:00
more_admin_filters little code cleanup - added some newlines at the end of the file 2021-07-16 12:19:30 +02:00
tests little code cleanup - added some newlines at the end of the file 2021-07-16 12:19:30 +02:00
.gitignore [tests] setup selenium live testcase 2020-09-05 13:51:45 +02:00
.travis.yml added official support for django 3.1 2020-09-13 16:31:24 +02:00
LICENCE initial commit 2020-09-04 18:40:00 +02:00
MANIFEST.in renamed project to django-more-admin-filters 2020-09-05 11:15:46 +02:00
README.rst [README] added a hint for the usage of annotation filters 2021-05-28 07:49:02 +02:00
setup.py Added support for Django 3.2 and Python 3.9 2021-07-16 12:08:58 +02:00
tox.ini Added support for Django 3.2 and Python 3.9 2021-07-16 12:08:58 +02:00

README.rst

====================================
Welcome to django-more-admin-filters
====================================

.. image:: https://travis-ci.com/thomst/django-more-admin-filters.svg?branch=master
    :target: https://travis-ci.com/thomst/django-more-admin-filters
    
.. image:: https://coveralls.io/repos/github/thomst/django-more-admin-filters/badge.svg?branch=master
    :target: https://coveralls.io/github/thomst/django-more-admin-filters?branch=master

.. image:: https://img.shields.io/badge/python-3.4%20%7C%203.5%20%7C%203.6%20%7C%203.7%20%7C%203.8-blue
   :target: https://img.shields.io/badge/python-3.4%20%7C%203.5%20%7C%203.6%20%7C%203.7%20%7C%203.8-blue
   :alt: python: 3.4, 3.5, 3.6, 3.7, 3.8

.. image:: https://img.shields.io/badge/django-1.11%20%7C%202.0%20%7C%202.1%20%7C%202.2%20%7C%203.0%20%7C%203.1-orange
   :target: https://img.shields.io/badge/django-1.11%20%7C%202.0%20%7C%202.1%20%7C%202.2%20%7C%203.0%20%7C%203.1-orange
   :alt: django: 1.11, 2.0, 2.1, 2.2, 3.0, 3.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.
* **MultiSelectDropdownFilter**
    Multi select dropdown filter for all kind of fields.
* **MultiSelectRelatedDropdownFilter**
    Multi select dropdown filter for relation fields.
* **BooleanAnnotationFilter**
    Filter for annotated boolean-attributes.


.. note:: More kind of annotation filters will be added in future versions.