diff options
Diffstat (limited to 'rest_framework')
| -rw-r--r-- | rest_framework/fields.py | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 6c07dbb3..80eff66c 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -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.  | 
