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.
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.
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#L675With django-rest-elasticsearch's
ListElasticMixin
the paginator property is namedes_paginator
and this is not added to the context of the response. By renaming the property topaginator
the pagination controls seem to appear.