'Returns a dictionary of all errors within a document
Keys are field names or list indices and values are the
validation error messages, or a nested dictionary of
errors for an embedded document or list.'

def to_dict(self):

    def build_dict(source):
        errors_dict = {}
        if (not source):
            return errors_dict
        if isinstance(source, dict):
            for (field_name, error) in source.iteritems():
                errors_dict[field_name] = build_dict(error)
        elif (isinstance(source, ValidationError) and source.errors):
            return build_dict(source.errors)
        else:
            return six.text_type(source)
        return errors_dict
    if (not self.errors):
        return {}
    return build_dict(self.errors)
