Update pagination.md

This commit is contained in:
Steve Lacey 2015-03-02 09:18:04 +00:00
parent 5f24aeb829
commit a5208e8c12

View File

@ -96,10 +96,9 @@ Let's modify the built-in `PageNumberPagination` style, so that instead of inclu
```py ```py
from rest_framework.pagination import PageNumberPagination from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.utils.urls import remove_query_param, replace_query_param
class LinkHeaderPagination(pagination.PageNumberPagination): class LinkHeaderPagination(PageNumberPagination):
def get_paginated_response(self, data): def get_paginated_response(self, data):
headers = { headers = {
'X-Page': self.page.number, 'X-Page': self.page.number,