Replies: 1 comment 3 replies
-
I guess you can make some decorator that will add from ninja.pagination import paginate
from ninja.decorators import decorate_view
def add_link_header(func):
def wrapper(request, *a, **kw):
response = func(request, *a, **kw)
response.headers['link'] = 'xxxx' # <-- TODO
return response
return wrapper
@api.get('/some')
@decorate_view(add_link_header) # <--- make sure decorate on view layer
@paginate
def some(request):
return queryset |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to support link header based pagination (something like this) using a custom pagination class? I'm probably missing something but I'm not seeing how to change response headers from there.
Beta Was this translation helpful? Give feedback.
All reactions