Skip to main content

A django library for input filters

Project description

Django Input Filter

A Django library for creating advanced input filters in admin interfaces.

Installation

Install the package using pip:

pip install django-input-filter

Configuration

Add django_input_filter to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = [
    ...
    'django_input_filter',
    ...
]

Usage Example

from django_input_filter import InputFilter

class NameContainsInputFilter(InputFilter):
    title = "Name Contains Filter"
    parameter_name = "name_contains"

    def queryset(self, request, queryset):
        term = self.value()
        if term is None:
            return queryset
        return queryset.filter(name__icontains=term)
@admin.register(ModelName)
class ModelNameAdmin(admin.ModelAdmin):
    ...
    list_filter = (
        ...
        NameContainsInputFilter
    )

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_input_filter-0.1.1.tar.gz (2.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_input_filter-0.1.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file django_input_filter-0.1.1.tar.gz.

File metadata

  • Download URL: django_input_filter-0.1.1.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.6 Windows/10

File hashes

Hashes for django_input_filter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 043c94ca9c60bb1073c0b0a54ed744815faf853a9bd2e8d21083907cf6089592
MD5 9fbddebd75245716fd14e2872f3af267
BLAKE2b-256 d338958fcd3b0e97a5bdc6f62d1d64c342dc4a9523d8bfd5d245064fdeee7be0

See more details on using hashes here.

File details

Details for the file django_input_filter-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_input_filter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3fde3b965fa5101b45ccbd8827480452a8f2aeae8b5e06bd4b812fc5238b9373
MD5 23323f7d27213df42e82664bc908fcc6
BLAKE2b-256 92580e899f1067c0e80a151e0a35825074c1a2428153b3d58dd00b285f9c3ee6

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