MCPcopy Create free account
hub / github.com/MongoEngine/mongoengine / as_dict

Method as_dict

mongoengine/queryset/field_list.py:72–78  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

70 return bool(self.fields)
71
72 def as_dict(self):
73 field_list = {field: self.value for field in self.fields}
74 if self.slice:
75 field_list.update(self.slice)
76 if self._id is not None:
77 field_list["_id"] = self._id
78 return field_list
79
80 def reset(self):
81 self.fields = set()

Callers 11

test_include_includeMethod · 0.95
test_include_excludeMethod · 0.95
test_exclude_excludeMethod · 0.95
test_exclude_includeMethod · 0.95
test_always_includeMethod · 0.95
test_resetMethod · 0.95
test_using_a_sliceMethod · 0.95
_cursor_argsMethod · 0.80
test_slicingMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by 10

test_include_includeMethod · 0.76
test_include_excludeMethod · 0.76
test_exclude_excludeMethod · 0.76
test_exclude_includeMethod · 0.76
test_always_includeMethod · 0.76
test_resetMethod · 0.76
test_using_a_sliceMethod · 0.76
test_slicingMethod · 0.64