mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 13:30:12 +03:00
Stripped indent now using a code block
This commit is contained in:
parent
ace82b78d6
commit
29c8146c00
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user