mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-02 20:54:42 +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):
|
def metadata(self):
|
||||||
data = super(ChoiceField, self).metadata()
|
data = super(ChoiceField, self).metadata()
|
||||||
data['choices'] = self.choices
|
data['choices'] = [{'value': v, 'name': n} for v, n in self.choices]
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user