Django-filter is a reusable Django application for allowing users to filter queryset dynamically.
Project description
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,
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-filter-0.5.2.tar.gz
.
File metadata
- Download URL: django-filter-0.5.2.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 180c83febf08ea50102f030424b8e4f5a510220975499b58176a81283ad1e546 |
|
MD5 | 5dc0a213a26555ee1305ca3ad527b710 |
|
BLAKE2b-256 | 5d167ea7a19767ce2bb3f9ace3998274845fccc28faf58b5be5001f2783c3306 |