mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
Add choices to options metadata for ChoiceField.
This commit is contained in:
parent
43c4e3aab8
commit
a38d9d5b24
|
@ -514,6 +514,11 @@ class ChoiceField(WritableField):
|
|||
|
||||
choices = property(_get_choices, _set_choices)
|
||||
|
||||
def metadata(self):
|
||||
data = super(ChoiceField, self).metadata()
|
||||
data['choices'] = self.choices
|
||||
return data
|
||||
|
||||
def validate(self, value):
|
||||
"""
|
||||
Validates that the input is in self.choices.
|
||||
|
|
Loading…
Reference in New Issue
Block a user