Expose to user mongoengine.base.NON_FIELD_ERRORS

This variable is used to set the field containing the errors raised in a
clean function. Given those function are user-defined, users should be
able to get the name of the field to easily retreive their custom errors.
This commit is contained in:
Emmanuel Leblond 2017-07-25 16:26:07 +02:00
parent 21d1faa793
commit 4f59c7f77f
No known key found for this signature in database
GPG Key ID: C360860E645EFFC0

View File

@ -19,7 +19,7 @@ from mongoengine.common import _import_class
from mongoengine.errors import (FieldDoesNotExist, InvalidDocumentError, from mongoengine.errors import (FieldDoesNotExist, InvalidDocumentError,
LookUpError, OperationError, ValidationError) LookUpError, OperationError, ValidationError)
__all__ = ('BaseDocument',) __all__ = ('BaseDocument', 'NON_FIELD_ERRORS')
NON_FIELD_ERRORS = '__all__' NON_FIELD_ERRORS = '__all__'