def mongoengine_validate_wrapper(old_clean, new_clean):

    def inner_validate(value):
        value = old_clean(value)
        try:
            new_clean(value)
            return value
        except ValidationError, e:
            raise forms.ValidationError(e)
    return inner_validate
A wrapper function to validate formdata against mongoengine-field
dataset/ETHPy150Open stephrdev/django-mongoforms/mongoforms/utils.py/mongoengine_validate_wrapper