# Path: webtools/formdata/exceptions.py
# class ValidateError(Exception):
#     pass


from .exceptions import ValidateError

class Type(object):
    """
    Base class for all type conversion
    for a formdata.
    """

    def to_python(self, value, field):
        return value

    def from_python(self, value):
        return value


class Integer(Type):
    def to_python(self, value, field):
        if len(value) != 1:

# Path: webtools/formdata/exceptions.py
# class ValidateError(Exception):
#     pass


# Path: webtools/formdata/data_types.py
from .exceptions import ValidateError


class Type(object):
    """
    Base class for all type conversion
    for a formdata.
    """

    def to_python(self, value, field):
        return value

    def from_python(self, value):
        return value


class Integer(Type):
    def to_python(self, value, field):
        if len(value) != 1:

            raise ValidateError("Invalid data")