django-filter 0.11.0

Django-filter is a reusable Django application for allowing users to filter querysets dynamically.

Django-filter is a reusable Django application for allowing users to filter querysets dynamically.

Full documentation on read the docs.

Requirements

  • Python 2.6+
  • Django 1.4.5+

Installation

Install using pip:

pip install django-filter

Or clone the repo and add to your PYTHONPATH:

git clone git@github.com:alex/django-filter.git

Usage

Django-filter can be used for generating interfaces similar to the Django admin's list_filter interface. It has an API very similar to Django's ModelForms. For example, if you had a Product model you could have a filterset for it with the code:

import django_filters

class ProductFilter(django_filters.FilterSet):
    class Meta:
        model = Product
        fields = ['name', 'price', 'manufacturer']

And then in your view you could do:

def product_list(request):
    filter = ProductFilter(request.GET, queryset=Product.objects.all())
    return render_to_response('my_app/template.html', {'filter': filter})

Django-filters additionally supports specifying FilterSet fields using a dictionary to specify filters with lookup types:

import django_filters

class ProductFilter(django_filters.FilterSet):
    class Meta:
        model = Product
        fields = {'name': ['exact', 'icontains'],
                  'price': ['exact', 'gte', 'lte'],
                 }

The filters will be available as 'name', 'name__icontains', 'price', 'price__gte', and 'price__lte' in the above example.

Support

If you have questions about usage or development you can join the mailing list.

BSD

Author

Alex Gaynor

Pip

django-filter==0.11.0

Classifiers

  • Development Status :: 5 - Production/Stable
  • Environment :: Web Environment
  • Framework :: Django
  • Intended Audience :: Developers
  • Operating System :: OS Independent
  • Programming Language :: Python
  • Programming Language :: Python :: 2.6
  • Programming Language :: Python :: 2.7
  • Programming Language :: Python :: 3
  • Programming Language :: Python :: 3.2
  • Programming Language :: Python :: 3.3
  • Programming Language :: Python :: 3.4
  • License :: OSI Approved :: BSD License
File Type Python Version Uploaded On Downloads
django_filter-0.11.0-py2.py3-none-any.whl Wheel 2.7 Aug. 14, 2015 2,744
django-filter-0.11.0.tar.gz Source Aug. 14, 2015 488
Version Release Date
0.11.0 Aug. 14, 2015
0.10.0 May 13, 2015
0.9.2 Jan. 23, 2015
0.9.1 Dec. 3, 2014
0.9.0 Nov. 28, 2014
0.8 Sept. 29, 2014
0.7 Aug. 10, 2013
0.6 March 25, 2013
0.6a1 March 12, 2013
0.5.4 Nov. 16, 2012
0.5.3 March 10, 2010
0.5.2 Nov. 30, 2009
0.5.1 Aug. 25, 2009
0.5.0 Aug. 14, 2009
0.2.0 June 19, 2009
0.1.0 May 8, 2009
Date Package Version Action
Aug. 24, 2015, 11:02 p.m. django-filter 0.5.3 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.5.2 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.5.1 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.5.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.6a1 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.5.4 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.2.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.9.1 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.1.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.6 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.7 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.11.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.8 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.9.2 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.10.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter 0.9.0 Release Created
Aug. 24, 2015, 11:02 p.m. django-filter Package Created