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

Method __getattr__

mongoengine/base/datastructures.py:463–470  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

461 return document[name]
462
463 def __getattr__(self, name):
464 if not object.__getattribute__(self, "passthrough"):
465 raise AttributeError()
466 document = self.fetch()
467 try:
468 return document[name]
469 except KeyError:
470 raise AttributeError()
471
472 def __repr__(self):
473 return f"<LazyReference({self.document_type}, {self.pk!r})>"

Callers

nothing calls this directly

Calls 2

fetchMethod · 0.95
__getattribute__Method · 0.80

Tested by

no test coverage detected