This repository was archived by the owner on Sep 2, 2020. It is now read-only.
This repository was archived by the owner on Sep 2, 2020. It is now read-only.
Pagination controls are not shown in browsable API #37
Open
Description
Hi,
Normally Django Rest Framework displays the pagination controls in the browsable API by default. With django-rest-elasticsearch's ListElasticAPIView
they are not visible, even if the corresponding fields (previous
, next
, count
) are present in the response data. This happens because the paginator is not added to the response context.
When building the context, DRF looks for the attribute paginator
in the view class:
https://github.com/encode/django-rest-framework/blob/master/rest_framework/renderers.py#L675
With django-rest-elasticsearch's ListElasticMixin
the paginator property is named es_paginator
and this is not added to the context of the response. By renaming the property to paginator
the pagination controls seem to appear.
Metadata
Metadata
Assignees
Labels
No labels