code: def to_python(self,value):
          
          if value==self.emptyValue or value in EMPTY_VALUES:
              return self.emptyValue
  
          try:
              value=self.coerce(value)
          except(ValueError,TypeError,ValidationError):
              raise ValidationError(self.error_messages['invalid_choice']%{'value':value})
  
          return value
docs: Validates that the value is in self.choices and can be coerced to the right type.