Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A generic system for filtering Django QuerySets based on user selections

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 django_filters
Octocat-spinner-32 docs
Octocat-spinner-32 .gitignore
Octocat-spinner-32 AUTHORS.txt
Octocat-spinner-32 COPYRIGHT
Octocat-spinner-32 MANIFEST.in
Octocat-spinner-32 README.txt
Octocat-spinner-32 setup.py
README.txt
Django-filter is a reusable Django application for allowing users to filter
queryset dynamically.  It requires Python 2.4 or higher.  For usage and
installation instructions consult the docs directory.

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 ProductFilterSet(django_filters.FilterSet):
        class Meta:
            model = Product
            fields = ['name', 'price', 'manufacturer']


And then in your view you could do::

    def product_list(request):
        filterset = ProductFilterSet(request.GET or None)
        return render_to_response('product/product_list.html',
            {'filterset': filterset})


See the docs directory for more information,
Something went wrong with that request. Please try again.