MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / build_dict

Method build_dict

mongoengine/errors.py:127–137  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

125 """
126
127 def build_dict(source):
128 errors_dict = {}
129 if isinstance(source, dict):
130 for field_name, error in source.items():
131 errors_dict[field_name] = build_dict(error)
132 elif isinstance(source, ValidationError) and source.errors:
133 return build_dict(source.errors)
134 else:
135 return str(source)
136
137 return errors_dict
138
139 if not self.errors:
140 return {}

Callers

nothing calls this directly

Calls 1

itemsMethod · 0.80

Tested by

no test coverage detected