MCPcopy
hub / github.com/django/django / _chain

Method _chain

django/db/models/query.py:2199–2215  ·  view source on GitHub ↗

Return a copy of the current QuerySet that's ready for another operation. If the QuerySet has opted in to in-place mutations via _disable_cloning() temporarily, the copy doesn't occur and instead the same QuerySet instance will be modified.

(self)

Source from the content-addressed store, hash-verified

2197 return PreventQuerySetCloning(self)
2198
2199 def _chain(self):
2200 """
2201 Return a copy of the current QuerySet that's ready for another
2202 operation.
2203
2204 If the QuerySet has opted in to in-place mutations via
2205 _disable_cloning() temporarily, the copy doesn't occur and instead the
2206 same QuerySet instance will be modified.
2207 """
2208 if not self._cloning_enabled:
2209 obj = self
2210 else:
2211 obj = self._clone()
2212 if obj._sticky_filter:
2213 obj.query.filter_is_sticky = True
2214 obj._sticky_filter = False
2215 return obj
2216
2217 def _clone(self):
2218 """

Callers 15

__getitem__Method · 0.95
__and__Method · 0.95
getMethod · 0.95
_earliestMethod · 0.95
deleteMethod · 0.95
_valuesMethod · 0.95
noneMethod · 0.95
allMethod · 0.95
_filter_or_excludeMethod · 0.95
complex_filterMethod · 0.95
_combinator_queryMethod · 0.95
select_for_updateMethod · 0.95

Calls 1

_cloneMethod · 0.95

Tested by

no test coverage detected