django-filter meets django-pagination
Project description
# django-filters-mixin
Simple integration between [django-filter](https://github.com/alex/django-filter) and [Django Pagination](https://docs.djangoproject.com/en/dev/topics/pagination/)
[![Latest Version](https://pypip.in/version/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
[![Downloads](https://pypip.in/download/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
[![License](https://pypip.in/license/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
### Requirements
You must have *django-filter* installed and configured, see the [django-filter documentation](https://github.com/alex/django-filter) for details and setup instructions.
## Installation
```shell
$ pip install django-filters-mixin
```
## Usage
The ``FilterMixin`` allows to use pagination together with filtering
```python
# 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.
Simple integration between [django-filter](https://github.com/alex/django-filter) and [Django Pagination](https://docs.djangoproject.com/en/dev/topics/pagination/)
[![Latest Version](https://pypip.in/version/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
[![Downloads](https://pypip.in/download/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
[![License](https://pypip.in/license/django-filters-mixin/badge.svg)](https://pypi.python.org/pypi/django-filters-mixin/)
### Requirements
You must have *django-filter* installed and configured, see the [django-filter documentation](https://github.com/alex/django-filter) for details and setup instructions.
## Installation
```shell
$ pip install django-filters-mixin
```
## Usage
The ``FilterMixin`` allows to use pagination together with filtering
```python
# 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
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-filters-mixin-0.1.2.tar.gz
.
File metadata
- Download URL: django-filters-mixin-0.1.2.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c67b10fed145dd3a739c208fe46bdbbb5f5ced3e94e84e1d81c1b7bddc7b238d |
|
MD5 | 761d32f34a8eeeafadcc897d12d077a6 |
|
BLAKE2b-256 | 892083210a945e611e2453ed0cc0041e9f4a20620d0370d3f327cf5778902a3e |