File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -608,18 +608,18 @@ def execute_sql(self, result_type):
608
608
except EmptyResultSet :
609
609
return 0
610
610
is_empty = not bool (values )
611
- rows = (
612
- 0
613
- if is_empty
614
- else self .collection .update_many (criteria , [{"$set" : values }]).matched_count
615
- )
611
+ rows = 0 if is_empty else self .update (criteria , [{"$set" : values }])
616
612
for query in self .query .get_related_updates ():
617
613
aux_rows = query .get_compiler (self .using ).execute_sql (result_type )
618
614
if is_empty and aux_rows :
619
615
rows = aux_rows
620
616
is_empty = False
621
617
return rows
622
618
619
+ @wrap_database_errors
620
+ def update (self , criteria , pipeline ):
621
+ return self .collection .update_many (criteria , pipeline ).matched_count
622
+
623
623
def get_where (self ):
624
624
return self .query .where
625
625
You can’t perform that action at this time.
0 commit comments