Stripped indent now using a code block

This commit is contained in:
Steve Lacey 2015-02-27 16:33:00 +00:00
parent ace82b78d6
commit 29c8146c00

View File

@ -86,12 +86,12 @@ Note that the `paginate_queryset` method may set state on the pagination instanc
Let's modify the built-in `PageNumberPagination` style, so that instead of include the pagination links in the body of the response, we'll instead include a `Link` header, in a [similar style to the GitHub API][github-link-pagination].
```py
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from rest_framework.utils.urls import remove_query_param, replace_query_param
from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from rest_framework.utils.urls import remove_query_param, replace_query_param
class LinkHeaderPagination(pagination.PageNumberPagination):
class LinkHeaderPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data):
first_url = self.get_first_link()
prev_url = self.get_previous_link()