mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
field
set read_only
and default
have bug
When i set `read_only` and `default` arguments together. The `default` argument do not work
This commit is contained in:
parent
8988afa082
commit
eab461ab64
|
@ -363,7 +363,7 @@ class Serializer(BaseSerializer, metaclass=SerializerMetaclass):
|
|||
@property
|
||||
def _writable_fields(self):
|
||||
for field in self.fields.values():
|
||||
if not field.read_only:
|
||||
if (not field.read_only) or (field.default is not empty):
|
||||
yield field
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue
Block a user