ReadPreference that overrides slave_okay (#218)
This commit is contained in:
parent
8c1f8e54cd
commit
5b161b7445
@ -1095,11 +1095,12 @@ class QuerySet(object):
|
|||||||
def _cursor_args(self):
|
def _cursor_args(self):
|
||||||
cursor_args = {
|
cursor_args = {
|
||||||
'snapshot': self._snapshot,
|
'snapshot': self._snapshot,
|
||||||
'timeout': self._timeout,
|
'timeout': self._timeout
|
||||||
'slave_okay': self._slave_okay,
|
|
||||||
}
|
}
|
||||||
if self._read_preference is not None:
|
if self._read_preference is not None:
|
||||||
cursor_args['read_preference'] = self._read_preference
|
cursor_args['read_preference'] = self._read_preference
|
||||||
|
else:
|
||||||
|
cursor_args['slave_okay'] = self._slave_okay
|
||||||
if self._loaded_fields:
|
if self._loaded_fields:
|
||||||
cursor_args['fields'] = self._loaded_fields.as_dict()
|
cursor_args['fields'] = self._loaded_fields.as_dict()
|
||||||
return cursor_args
|
return cursor_args
|
||||||
|
Loading…
x
Reference in New Issue
Block a user