mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-12-05 09:14:01 +03:00
Merge dc1e9d2a95 into 442444f0be
This commit is contained in:
commit
d961cebc19
|
|
@ -609,8 +609,14 @@ class ListSerializer(BaseSerializer):
|
|||
self.child.bind(field_name='', parent=self)
|
||||
|
||||
def get_initial(self):
|
||||
"""
|
||||
Return a list of initial values, one for each item in `initial_data`,
|
||||
or an empty list if no input data was provided.
|
||||
"""
|
||||
if hasattr(self, 'initial_data'):
|
||||
return self.to_representation(self.initial_data)
|
||||
if isinstance(self.initial_data, list):
|
||||
return [self.child.get_initial() for _ in self.initial_data]
|
||||
return []
|
||||
return []
|
||||
|
||||
def get_value(self, dictionary):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user