mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Resolve issue with rendering nested serializer forms with empty values. Closes #3260.
This commit is contained in:
parent
0df99a6c95
commit
a3e64fbe0d
|
@ -101,6 +101,9 @@ class NestedBoundField(BoundField):
|
||||||
return BoundField(field, value, error, prefix=self.name + '.')
|
return BoundField(field, value, error, prefix=self.name + '.')
|
||||||
|
|
||||||
def as_form_field(self):
|
def as_form_field(self):
|
||||||
|
if self.value is None:
|
||||||
|
return ''
|
||||||
|
|
||||||
values = {}
|
values = {}
|
||||||
for key, value in self.value.items():
|
for key, value in self.value.items():
|
||||||
if isinstance(value, (list, dict)):
|
if isinstance(value, (list, dict)):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user