diff options
| author | Tom Christie | 2014-09-11 13:20:44 +0100 |
|---|---|---|
| committer | Tom Christie | 2014-09-11 13:20:44 +0100 |
| commit | de301f3b6647e1c79a506405a88071ef977418d1 (patch) | |
| tree | 407f3497b422f334b47088b0bb35d39a8a3a520a /rest_framework/pagination.py | |
| parent | 80ba0473473501968154c5cc5dd5922e53d96a70 (diff) | |
| parent | 015a8122c7738dd8913939b42d3f0ec932d88711 (diff) | |
| download | django-rest-framework-de301f3b6647e1c79a506405a88071ef977418d1.tar.bz2 | |
Merge master
Diffstat (limited to 'rest_framework/pagination.py')
| -rw-r--r-- | rest_framework/pagination.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rest_framework/pagination.py b/rest_framework/pagination.py index 478d32b4..9cf31629 100644 --- a/rest_framework/pagination.py +++ b/rest_framework/pagination.py @@ -43,8 +43,9 @@ class DefaultObjectSerializer(serializers.Field): as the default. """ - def __init__(self, source=None, context=None): - # Note: Swallow context kwarg - only required for eg. ModelSerializer. + def __init__(self, source=None, many=None, context=None): + # Note: Swallow context and many kwargs - only required for + # eg. ModelSerializer. super(DefaultObjectSerializer, self).__init__(source=source) @@ -61,6 +62,7 @@ class BasePaginationSerializer(serializers.Serializer): """ super(BasePaginationSerializer, self).__init__(*args, **kwargs) results_field = self.results_field + try: object_serializer = self.Meta.object_serializer_class except AttributeError: @@ -70,7 +72,7 @@ class BasePaginationSerializer(serializers.Serializer): child=object_serializer(), source='object_list' ) - self.fields[results_field].bind(results_field, self, self) # TODO: Support automatic binding + self.fields[results_field].bind(results_field, self, self) class PaginationSerializer(BasePaginationSerializer): |
