Fixing cloning in python 3

This commit is contained in:
Ross Lawley 2013-04-12 12:55:03 +00:00
parent a84ffce5a0
commit 49a7542b14
2 changed files with 9 additions and 9 deletions

View File

@ -2,6 +2,11 @@
Changelog 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 Changes in 0.7.9
================ ================
- Better fix handling for old style _types - Better fix handling for old style _types

View File

@ -379,8 +379,8 @@ class QuerySet(object):
c = self.__class__(self._document, self._collection_obj) c = self.__class__(self._document, self._collection_obj)
copy_props = ('_initial_query', '_query_obj', '_where_clause', copy_props = ('_initial_query', '_query_obj', '_where_clause',
'_loaded_fields', '_ordering', '_snapshot', '_loaded_fields', '_ordering', '_snapshot', '_timeout',
'_timeout', '_limit', '_skip', '_slave_okay', '_hint') '_limit', '_skip', '_slave_okay', '_hint')
for prop in copy_props: for prop in copy_props:
val = getattr(self, prop) val = getattr(self, prop)
@ -393,11 +393,6 @@ class QuerySet(object):
if self._mongo_query is None: if self._mongo_query is None:
self._mongo_query = self._query_obj.to_query(self._document) self._mongo_query = self._query_obj.to_query(self._document)
if self._class_check: 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 return self._mongo_query