aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Foote2013-11-26 17:10:16 +0000
committerIan Foote2013-11-26 17:10:16 +0000
commit2484fc914159571a3867c2dae2d9b51314f4581d (patch)
tree2024d4dd4bdc86b0f407f4301265631bd0860c68
parenta38d9d5b24501ae0e279c9afbea08e423112ba34 (diff)
downloaddjango-rest-framework-2484fc914159571a3867c2dae2d9b51314f4581d.tar.bz2
Add more context to the ChoiceField metadata.
-rw-r--r--rest_framework/fields.py2
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):