Skip to main content

django-filter meets django-pagination

Project description

django-filters-mixin

Simple integration between django-filter and pagination

https://img.shields.io/pypi/v/django-filters-mixin.svg https://img.shields.io/pypi/dm/django-filters-mixin.svg https://img.shields.io/github/license/bashu/django-filters-mixin.svg

Requirements

You must have django-filter installed and configured, see the django-filter documentation for details and setup instructions.

Installation

pip install django-filters-mixin

Usage

The FilterMixin allows to use pagination together with filtering

# views.py

import django_filters
from filters.views import FilterMixin


class CustomFilterSet(django_filters.FilterSet):
    # read https://github.com/alex/django-filter#usage
    ...


class CustomFilterView(FilterMixin, django_filters.views.FilterView):
    filterset_class = CustomFilterSet
    paginate_by = 12
    ...

Please see example application. This application is used to manually test the functionalities of this package. This also serves as good example…

You need Django 1.4 or above to run that. It might run on older versions but that is not tested.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django_filters_mixin-0.1.4-py2.py3-none-any.whl (4.4 kB) Copy SHA256 hash SHA256 Wheel 2.7 Oct 14, 2016
django-filters-mixin-0.1.4.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None Oct 14, 2016

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