MCPcopy
hub / github.com/django/django / update_batch

Method update_batch

django/db/models/sql/subqueries.py:72–79  ·  view source on GitHub ↗
(self, pk_list, values, using)

Source from the content-addressed store, hash-verified

70 return obj
71
72 def update_batch(self, pk_list, values, using):
73 self.add_update_values(values)
74 for offset in range(0, len(pk_list), GET_ITERATOR_CHUNK_SIZE):
75 self.clear_where()
76 self.add_filter(
77 "pk__in", pk_list[offset : offset + GET_ITERATOR_CHUNK_SIZE]
78 )
79 self.get_compiler(using).execute_sql(NO_RESULTS)
80
81 def add_update_values(self, values):
82 """

Callers 1

deleteMethod · 0.80

Calls 5

add_update_valuesMethod · 0.95
clear_whereMethod · 0.80
add_filterMethod · 0.80
get_compilerMethod · 0.80
execute_sqlMethod · 0.45

Tested by

no test coverage detected