UNKNOWN
Project description
# Django Rest Framework QuerySet
Mimicking the Django ORM queryset so that can be used ListViews for pagination
## Usage:
```python
from django.views.generic import ListView
from rest_framework_queryset import RestFrameworkQuerySet
class ListDataView(ListView):
paginate_by = 10
template_name = 'list.html'
def get_queryset(self, *args, **kwargs):
return RestFrameworkQuerySet('http://localhost:8082/api/').filter(**self.request.GET.dict())
```
## Dependencies
The queryset is dependent on the API that uses [LimiteOffsetPagination](http://www.django-rest-framework.org/api-guide/pagination/#limitoffsetpagination)
If you are using [PageNumberPagination](http://www.django-rest-framework.org/api-guide/pagination/#pagenumberpagination) then you can use the included `rest_framework_queryset.pagination.HybridPagination` which will switch pagination class depends on the query param is passed.
Mimicking the Django ORM queryset so that can be used ListViews for pagination
## Usage:
```python
from django.views.generic import ListView
from rest_framework_queryset import RestFrameworkQuerySet
class ListDataView(ListView):
paginate_by = 10
template_name = 'list.html'
def get_queryset(self, *args, **kwargs):
return RestFrameworkQuerySet('http://localhost:8082/api/').filter(**self.request.GET.dict())
```
## Dependencies
The queryset is dependent on the API that uses [LimiteOffsetPagination](http://www.django-rest-framework.org/api-guide/pagination/#limitoffsetpagination)
If you are using [PageNumberPagination](http://www.django-rest-framework.org/api-guide/pagination/#pagenumberpagination) then you can use the included `rest_framework_queryset.pagination.HybridPagination` which will switch pagination class depends on the query param is passed.
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
Close
Hashes for django-rest-framework-queryset-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3adcb3c4fc18f8b95fb6ec9733662855b10c3fa1b723c747d7c1bb68d91c94e4 |
|
MD5 | 83bce953b91b4c624eeaac9e91275514 |
|
BLAKE2b-256 | 320fbd0b2455f03d7f2969243a605fba4d3d7f76b3193818b796f481789b0c7c |