This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Custom paginations for django rest framework

Compatibility

work with :
  • Python 2.7 / 3.4
  • Dango 1.6 / 1.7
  • Django Rest Framework 2.4 / 3.0

Installation

Install the package from pypi:

pip install djangorestframework-custom-paginations

Add the application in your django settings:

DJANGO_APPS = ('rest_framework_custom_paginations',)

Configure your rest framework :

REST_FRAMEWORK = {
    'DEFAULT_PAGINATION_SERIALIZER_CLASS': 'rest_framework_custom_paginations.paginations.SporePaginationSerializer'
}

Usage

Add the following parameters in a ListAPIView :

class PersonList(generics.ListAPIView):
    """ list of person """
    ...
    paginate_by = 100
    paginate_by_param = 'page_size'
    max_paginate_by = 500

Example

Results of Spore Pagination :

{
    "count": 532,
    "next": "http://myurls/persons.json?structure=mystructure&page=3",
    "next_params": {
        "page": 3,
        "structure": "mystructure"
    },
    "num_pages": 6,
    "previous": "http://myurls/persons.json?structure=mystructure&page=1",
    "previous_params": {
        "page": 1,
        "structure": "mystructure"
    },
    "results": [
        ...
    ]
}
Release History

Release History

1.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
djangorestframework-custom-paginations-1.1.0.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Jun 2, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting