re-create the cursor object whenever we apply read_preference

This commit is contained in:
Stefan Wojcik
2015-06-24 22:34:38 -07:00
parent 6868f66f24
commit a7aead5138
3 changed files with 49 additions and 1 deletions

View File

@@ -930,6 +930,7 @@ class BaseQuerySet(object):
validate_read_preference('read_preference', read_preference)
queryset = self.clone()
queryset._read_preference = read_preference
queryset._cursor_obj = None # we need to re-create the cursor object whenever we apply read_preference
return queryset
def scalar(self, *fields):