re-create the cursor object whenever we apply read_preference

This commit is contained in:
Stefan Wojcik
2015-11-23 10:46:52 -08:00
parent 6868f66f24
commit a7aead5138
3 changed files with 49 additions and 1 deletions
+1
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):