Fix no_cursor_timeout with pymongo3

This commit is contained in:
xiaost 2016-05-26 00:29:41 +08:00
parent 0a431ead5e
commit 1f223aa7e6

View File

@ -1462,7 +1462,7 @@ class BaseQuerySet(object):
msg = "The snapshot option is not anymore available with PyMongo 3+" msg = "The snapshot option is not anymore available with PyMongo 3+"
warnings.warn(msg, DeprecationWarning) warnings.warn(msg, DeprecationWarning)
cursor_args = { cursor_args = {
'no_cursor_timeout': self._timeout 'no_cursor_timeout': not self._timeout
} }
if self._loaded_fields: if self._loaded_fields:
cursor_args[fields_name] = self._loaded_fields.as_dict() cursor_args[fields_name] = self._loaded_fields.as_dict()