Merge pull request #5207 from ryanpetrello/fix-4356

add the max_page_size value to the OPTIONS response for list views
This commit is contained in:
Ryan Petrello 2017-02-07 10:29:22 -05:00 committed by GitHub
commit 81805c780f

View File

@ -191,6 +191,10 @@ class Metadata(metadata.SimpleMetadata):
if getattr(view, 'related_search_fields', None):
metadata['related_search_fields'] = view.related_search_fields
from rest_framework import generics
if isinstance(view, generics.ListAPIView) and hasattr(view, 'paginator'):
metadata['max_page_size'] = view.paginator.max_page_size
return metadata