nicolaiarocci/cerberus — pull request #18 by markon (2013-08-19 09:25:19+00:00)
Title: Operation validator should be called AFTER type validation.

When you implement a new data type, e.g., 'number', you'd expect it to be actually checked before the operations get validated. The test shows that currently you have to modify your method "_validate_min_number" and catch the exception raised by calling int(value), like the following:

```python
def _validate_min_number(self, min_value, field, value):
"""Validates the 'min_number' operation on the 'number' data type."""
try:
value = int(value)
except ValueError:
return super(BaseValidator, self)._validate_min(min_value, field, value)
```

Otherwise, you`ll get a ValueError, instead of a ValidationError (or whatever).