Fixing cloning in python 3
This commit is contained in:
parent
a84ffce5a0
commit
49a7542b14
@ -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
|
||||||
|
@ -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,16 +393,11 @@ 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:
|
self._mongo_query.update(self._initial_query)
|
||||||
query = SON(self._initial_query.items())
|
|
||||||
query.update(self._mongo_query)
|
|
||||||
self._mongo_query = query
|
|
||||||
else:
|
|
||||||
self._mongo_query.update(self._initial_query)
|
|
||||||
return self._mongo_query
|
return self._mongo_query
|
||||||
|
|
||||||
def ensure_index(self, key_or_list, drop_dups=False, background=False,
|
def ensure_index(self, key_or_list, drop_dups=False, background=False,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
"""Ensure that the given indexes are in place.
|
"""Ensure that the given indexes are in place.
|
||||||
|
|
||||||
:param key_or_list: a single index key or a list of index keys (to
|
:param key_or_list: a single index key or a list of index keys (to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user