diff options
| author | Ian Foote | 2013-11-26 17:10:16 +0000 |
|---|---|---|
| committer | Ian Foote | 2013-11-26 17:10:16 +0000 |
| commit | 2484fc914159571a3867c2dae2d9b51314f4581d (patch) | |
| tree | 2024d4dd4bdc86b0f407f4301265631bd0860c68 | |
| parent | a38d9d5b24501ae0e279c9afbea08e423112ba34 (diff) | |
| download | django-rest-framework-2484fc914159571a3867c2dae2d9b51314f4581d.tar.bz2 | |
Add more context to the ChoiceField metadata.
| -rw-r--r-- | rest_framework/fields.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 80eff66c..1657e57f 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -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): |
