MCPcopy
hub / github.com/django/django / chain

Method chain

django/db/models/sql/query.py:432–445  ·  view source on GitHub ↗

Return a copy of the current Query that's ready for another operation. The klass argument changes the type of the Query, e.g. UpdateQuery.

(self, klass=None)

Source from the content-addressed store, hash-verified

430 return obj
431
432 def chain(self, klass=None):
433 """
434 Return a copy of the current Query that's ready for another operation.
435 The klass argument changes the type of the Query, e.g. UpdateQuery.
436 """
437 obj = self.clone()
438 if klass and obj.__class__ != klass:
439 obj.__class__ = klass
440 if not obj.filter_is_sticky:
441 obj.used_aliases = set()
442 obj.filter_is_sticky = False
443 if hasattr(obj, "_setup_query"):
444 obj._setup_query()
445 return obj
446
447 def relabeled_clone(self, change_map):
448 clone = self.clone()

Callers 12

iter_modules_and_filesFunction · 0.45
wrapperFunction · 0.45
shuffle_testsFunction · 0.45
aggregateMethod · 0.45
updateMethod · 0.45
_updateMethod · 0.45
_cloneMethod · 0.45
usingMethod · 0.45
pre_sql_setupMethod · 0.45
assertFormErrorMethod · 0.45
delete_tablesMethod · 0.45

Calls 2

cloneMethod · 0.95
_setup_queryMethod · 0.80

Tested by 3

assertFormErrorMethod · 0.36
delete_tablesMethod · 0.36