djangorestframework-pagination-1.1
توضیحات
response pagination using django restframework
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | djangorestframework-pagination-1.1 |
| نام | djangorestframework-pagination |
| نسخه کتابخانه | 1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Ali Shekari |
| ایمیل نویسنده | alishekari1991@outlook.com |
| آدرس صفحه اصلی | https://github.com/alishekari/djangorestframework_pagination |
| آدرس اینترنتی | https://pypi.org/project/djangorestframework-pagination/ |
| مجوز | - |
example:
```
class TestAPI(APIView):
@staticmethod
def get(request):
tests = Test.objects.all() # filter or order by or anything else
pagination = PaginationObject(objects=tests, page=1, numbers_in_page=10,
serializer=TestSerializer)
return Response(pagination.serializer_data(), status=status.HTTP_200_OK)
```
to get all objects in one page :
```
pagination = PaginationObject(objects=tests, page=1, numbers_in_page=-1,
serializer=TestSerializer)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.0 | Python |
نحوه نصب
نصب پکیج whl djangorestframework-pagination-1.1:
pip install djangorestframework-pagination-1.1.whl
نصب پکیج tar.gz djangorestframework-pagination-1.1:
pip install djangorestframework-pagination-1.1.tar.gz