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

Method __get__

mongoengine/base/fields.py:167–174  ·  view source on GitHub ↗

Descriptor for retrieving a value from a field in a document.

(self, instance, owner)

Source from the content-addressed store, hash-verified

165 return self.__auto_dereference and not self._no_dereference_context_is_set
166
167 def __get__(self, instance, owner):
168 """Descriptor for retrieving a value from a field in a document."""
169 if instance is None:
170 # Document class being used rather than a document object
171 return self
172
173 # Get value from document instance if available
174 return instance._data.get(self.name)
175
176 def __set__(self, instance, value):
177 """Descriptor for assigning a value to a field in a document."""

Callers 1

__get__Method · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected