You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 namedes_paginator
and this is not added to the context of the response. By renaming the property topaginator
the pagination controls seem to appear.The text was updated successfully, but these errors were encountered: