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

Method select_related

mongoengine/queryset/base.py:874–882  ·  view source on GitHub ↗

Handles dereferencing of :class:`~bson.dbref.DBRef` objects or :class:`~bson.object_id.ObjectId` 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

872 return new_qs
873
874 def select_related(self, max_depth=1):
875 """Handles dereferencing of :class:`~bson.dbref.DBRef` objects or
876 :class:`~bson.object_id.ObjectId` a maximum depth in order to cut down
877 the number queries to mongodb.
878 """
879 # Make select related work the same for querysets
880 max_depth += 1
881 queryset = self.clone()
882 return queryset._dereference(queryset, max_depth=max_depth)
883
884 def limit(self, n):
885 """Limit the number of returned documents to `n`. This may also be

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.95
_dereferenceMethod · 0.80

Tested by

no test coverage detected