def to_python(self,value):
        """
        Validates that the value is in self.choices and can be coerced to the right type.
        """
        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