mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-12-18 06:06:53 +03:00
return None values as None in ListSerializer.to_representation
This commit is contained in:
parent
9864c47018
commit
57d837c826
|
@ -711,7 +711,7 @@ class ListSerializer(BaseSerializer):
|
||||||
iterable = data.all() if isinstance(data, models.manager.BaseManager) else data
|
iterable = data.all() if isinstance(data, models.manager.BaseManager) else data
|
||||||
|
|
||||||
return [
|
return [
|
||||||
self.child.to_representation(item) for item in iterable
|
self.child.to_representation(item) if item is not None else None for item in iterable
|
||||||
]
|
]
|
||||||
|
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user