mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
Merge eee582af41
into 836e49b535
This commit is contained in:
commit
d2e7617a1f
|
@ -1039,7 +1039,7 @@ class ModelSerializer(Serializer):
|
||||||
set of fields, but also takes into account the `Meta.fields` or
|
set of fields, but also takes into account the `Meta.fields` or
|
||||||
`Meta.exclude` options if they have been specified.
|
`Meta.exclude` options if they have been specified.
|
||||||
"""
|
"""
|
||||||
fields = getattr(self.Meta, 'fields', None)
|
fields = getattr(self.Meta, 'fields', getattr(self.Meta, 'include', None))
|
||||||
exclude = getattr(self.Meta, 'exclude', None)
|
exclude = getattr(self.Meta, 'exclude', None)
|
||||||
|
|
||||||
if fields and fields != ALL_FIELDS and not isinstance(fields, (list, tuple)):
|
if fields and fields != ALL_FIELDS and not isinstance(fields, (list, tuple)):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user