Skip to main content

A collection of addons for django-filter

Project description

django-filter-addons Build Status

A collection of addons for django-filter

Installation

Install the package from PyPi:

pip install django-filter-addons

Usage

Implement case-insensitivity on queryset ordering:

from django.contrib.auth.models import User
from django.db.models.functions import Lower

from django_filters.filters import CharFilter
from django_filters.filterset import FilterSet

from django_filters_addons.filters import OrderingFilter

class UserFilter(FilterSet):
    account = CharFilter(field_name='username')
    sort = OrderingFilter(
        fields={'username': 'account', 'email': 'email'},
        field_cases={'account': Lower},
    )

    class Meta:
        model = User
        fields = ('email',)

License

django-filter-addons is released under the MIT license.

Project details


Download files

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

Files for django-filter-addons, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_filter_addons-0.1.0-py3-none-any.whl (4.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size django-filter-addons-0.1.0.tar.gz (2.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page