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 @@ -611,18 +611,18 @@ def execute_sql(self, result_type):
611
611
except EmptyResultSet :
612
612
return 0
613
613
is_empty = not bool (values )
614
- rows = (
615
- 0
616
- if is_empty
617
- else self .collection .update_many (criteria , [{"$set" : values }]).matched_count
618
- )
614
+ rows = 0 if is_empty else self .update (criteria , [{"$set" : values }])
619
615
for query in self .query .get_related_updates ():
620
616
aux_rows = query .get_compiler (self .using ).execute_sql (result_type )
621
617
if is_empty and aux_rows :
622
618
rows = aux_rows
623
619
is_empty = False
624
620
return rows
625
621
622
+ @wrap_database_errors
623
+ def update (self , criteria , pipeline ):
624
+ return self .collection .update_many (criteria , pipeline ).matched_count
625
+
626
626
def get_where (self ):
627
627
return self .query .where
628
628
You can’t perform that action at this time.
0 commit comments