From 49a7542b148686b2c4ab43ed1f87195138c651da Mon Sep 17 00:00:00 2001 From: Ross Lawley Date: Fri, 12 Apr 2013 12:55:03 +0000 Subject: [PATCH] Fixing cloning in python 3 --- docs/changelog.rst | 5 +++++ mongoengine/queryset.py | 13 ++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d93bf13c..7957560f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,6 +2,11 @@ Changelog ========= +Changes in 0.7.10 +================= +- Int fields no longer unset in save when changed to 0 (#272) +- Fixed ReferenceField query chaining bug fixed (#254) + Changes in 0.7.9 ================ - Better fix handling for old style _types diff --git a/mongoengine/queryset.py b/mongoengine/queryset.py index 6c61ab9e..20b18b7e 100644 --- a/mongoengine/queryset.py +++ b/mongoengine/queryset.py @@ -379,8 +379,8 @@ class QuerySet(object): c = self.__class__(self._document, self._collection_obj) copy_props = ('_initial_query', '_query_obj', '_where_clause', - '_loaded_fields', '_ordering', '_snapshot', - '_timeout', '_limit', '_skip', '_slave_okay', '_hint') + '_loaded_fields', '_ordering', '_snapshot', '_timeout', + '_limit', '_skip', '_slave_okay', '_hint') for prop in copy_props: val = getattr(self, prop) @@ -393,16 +393,11 @@ class QuerySet(object): if self._mongo_query is None: self._mongo_query = self._query_obj.to_query(self._document) if self._class_check: - if PY3: - query = SON(self._initial_query.items()) - query.update(self._mongo_query) - self._mongo_query = query - else: - self._mongo_query.update(self._initial_query) + self._mongo_query.update(self._initial_query) return self._mongo_query def ensure_index(self, key_or_list, drop_dups=False, background=False, - **kwargs): + **kwargs): """Ensure that the given indexes are in place. :param key_or_list: a single index key or a list of index keys (to