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

Method __get__

mongoengine/fields.py:2472–2482  ·  view source on GitHub ↗

Descriptor to allow lazy dereferencing.

(self, instance, owner)

Source from the content-addressed store, hash-verified

2470 return value
2471
2472 def __get__(self, instance, owner):
2473 """Descriptor to allow lazy dereferencing."""
2474 if instance is None:
2475 # Document class being used rather than a document object
2476 return self
2477
2478 value = self.build_lazyref(instance._data.get(self.name))
2479 if value:
2480 instance._data[self.name] = value
2481
2482 return super().__get__(instance, owner)
2483
2484 def to_mongo(self, value):
2485 if isinstance(value, LazyReference):

Callers

nothing calls this directly

Calls 3

build_lazyrefMethod · 0.95
getMethod · 0.45
__get__Method · 0.45

Tested by

no test coverage detected