MCPcopy
hub / github.com/django/django / relabel_aliases

Method relabel_aliases

django/db/models/sql/where.py:203–215  ·  view source on GitHub ↗

Relabel the alias values of any children. 'change_map' is a dictionary mapping old (current) alias values to the new values.

(self, change_map)

Source from the content-addressed store, hash-verified

201 self.children = children
202
203 def relabel_aliases(self, change_map):
204 """
205 Relabel the alias values of any children. 'change_map' is a dictionary
206 mapping old (current) alias values to the new values.
207 """
208 if not change_map:
209 return self
210 for pos, child in enumerate(self.children):
211 if hasattr(child, "relabel_aliases"):
212 # For example another WhereNode
213 child.relabel_aliases(change_map)
214 elif hasattr(child, "relabeled_clone"):
215 self.children[pos] = child.relabeled_clone(change_map)
216
217 def clone(self):
218 clone = self.create(connector=self.connector, negated=self.negated)

Callers 3

relabeled_cloneMethod · 0.80
combineMethod · 0.80
change_aliasesMethod · 0.80

Calls 1

relabeled_cloneMethod · 0.45

Tested by

no test coverage detected