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', 'first_name': 'first_name', 'last_name': 'last_name', 'email': 'email'},
        field_cases={'username': Lower, 'email': Lower},
    )

    class Meta:
        model = User
        fields = ('first_name', 'last_name', '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.

Source Distribution

django-filter-addons-0.2.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

django_filter_addons-0.2.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file django-filter-addons-0.2.0.tar.gz.

File metadata

  • Download URL: django-filter-addons-0.2.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for django-filter-addons-0.2.0.tar.gz
Algorithm Hash digest
SHA256 679968ac96746737beeb3ef932df5e52e6499e8deaf9daea91fb3056c1f80fa3
MD5 eb38f34d8054fd9fdc010cb6d8e6298b
BLAKE2b-256 2089b3a4a2dd416ce4e4f101df67d8cdb5b40c54fad6700bb206cc93733d9c30

See more details on using hashes here.

File details

Details for the file django_filter_addons-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: django_filter_addons-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for django_filter_addons-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7467a6f75156404a3fe0b8d72e410bda7a61ea196f1ac30dd0ea5a2b9174ee7
MD5 3ff0c1d465937283a6a37f1896c64f2c
BLAKE2b-256 e53024362bd7f599dcd3d275c6f404f7a13e6b04fcb0434cd1c936884891ca54

See more details on using hashes here.

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