From 9f551121fbbe852bd639ce4999ad0835db3fd8a6 Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Thu, 24 Jan 2013 17:41:21 +0000 Subject: [PATCH] Added docs for no_dereference and scalar (#68) --- mongoengine/queryset/queryset.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mongoengine/queryset/queryset.py b/mongoengine/queryset/queryset.py index f73b0e7c..b5e33515 100644 --- a/mongoengine/queryset/queryset.py +++ b/mongoengine/queryset/queryset.py @@ -748,8 +748,12 @@ class QuerySet(object): """Instead of returning Document instances, return either a specific value or a tuple of values in order. - This effects all results and can be unset by calling ``scalar`` - without arguments. Calls ``only`` automatically. + Can be used along with + :func:`~mongoengine.queryset.QuerySet.no_dereference` to turn off + dereferencing. + + .. note:: This effects all results and can be unset by calling + ``scalar`` without arguments. Calls ``only`` automatically. :param fields: One or more fields to return instead of a Document. """ @@ -1139,7 +1143,8 @@ class QuerySet(object): return self.__dereference def no_dereference(self): - """Turn off any dereferencing.""" + """Turn off any dereferencing for the results of this queryset. + """ queryset = self.clone() queryset._auto_dereference = False return queryset