From 2a8d0012136b83de78bff5f897670ad9cd3bc42a Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Mon, 11 Jul 2011 17:02:23 +0100 Subject: [PATCH] Improvements to indexes and efficiencies Thanks to @dcrosta for the patches closes #225 --- mongoengine/queryset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mongoengine/queryset.py b/mongoengine/queryset.py index d82708c3..de80a3d2 100644 --- a/mongoengine/queryset.py +++ b/mongoengine/queryset.py @@ -320,7 +320,7 @@ class QuerySet(object): providing :class:`~mongoengine.Document` objects as the results. """ - ALREADY_INDEXED = set() + __already_indexed = set() def __init__(self, document, collection): self._document = document @@ -468,8 +468,8 @@ class QuerySet(object): """Property that returns the collection object. This allows us to perform operations only if the collection is accessed. """ - if self._document not in QuerySet.ALREADY_INDEXED: - QuerySet.ALREADY_INDEXED.add(self._document) + if self._document not in QuerySet.__already_indexed: + QuerySet.__already_indexed.add(self._document) background = self._document._meta.get('index_background', False) drop_dups = self._document._meta.get('index_drop_dups', False)