Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Pagination controls are not shown in browsable API #37

Open
aleehedl opened this issue Jul 20, 2018 · 0 comments
Open

Pagination controls are not shown in browsable API #37

aleehedl opened this issue Jul 20, 2018 · 0 comments

Comments

@aleehedl
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant