mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-23 22:49:50 +03:00
Merge ba735e6d27
into 9a741e7ddb
This commit is contained in:
commit
1f0eb865a3
|
@ -420,6 +420,10 @@ class ModelSerializer(Serializer):
|
||||||
models.CommaSeparatedIntegerField: CharField,
|
models.CommaSeparatedIntegerField: CharField,
|
||||||
models.BooleanField: BooleanField,
|
models.BooleanField: BooleanField,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if model_field.flatchoices: # This ModelField contains choices
|
||||||
|
ret = ChoiceField(model_field.flatchoices)
|
||||||
|
else:
|
||||||
try:
|
try:
|
||||||
ret = field_mapping[model_field.__class__]()
|
ret = field_mapping[model_field.__class__]()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user