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

Method select_related

mongoengine/document.py:754–760  ·  view source on GitHub ↗

Handles dereferencing of :class:`~bson.dbref.DBRef` objects to a maximum depth in order to cut down the number queries to mongodb.

(self, max_depth=1)

Source from the content-addressed store, hash-verified

752 return self
753
754 def select_related(self, max_depth=1):
755 """Handles dereferencing of :class:`~bson.dbref.DBRef` objects to
756 a maximum depth in order to cut down the number queries to mongodb.
757 """
758 DeReference = _import_class("DeReference")
759 DeReference()([self], max_depth + 1)
760 return self
761
762 def reload(self, *fields, **kwargs):
763 """Reloads all attributes from the database.

Calls 2

_import_classFunction · 0.90
DeReferenceClass · 0.85