Add choices to options metadata for ChoiceField.

This commit is contained in:
Ian Foote 2013-11-26 09:33:47 +00:00
parent 43c4e3aab8
commit a38d9d5b24

View File

@ -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.