mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Add more context to the ChoiceField metadata.
This commit is contained in:
parent
a38d9d5b24
commit
2484fc9141
|
@ -516,7 +516,7 @@ class ChoiceField(WritableField):
|
|||
|
||||
def metadata(self):
|
||||
data = super(ChoiceField, self).metadata()
|
||||
data['choices'] = self.choices
|
||||
data['choices'] = [{'value': v, 'name': n} for v, n in self.choices]
|
||||
return data
|
||||
|
||||
def validate(self, value):
|
||||
|
|
Loading…
Reference in New Issue
Block a user