1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #33319 -- Added comment about keys/values assertion in Query.change_aliases().

This commit is contained in:
Ömer Faruk Abacı 2021-12-08 10:11:12 +01:00 committed by Mariusz Felisiak
parent cb383753c0
commit f1bfdff690

View File

@ -846,6 +846,9 @@ class Query(BaseExpression):
relabelling any references to them in select columns and the where
clause.
"""
# If keys and values of change_map were to intersect, an alias might be
# updated twice (e.g. T4 -> T5, T5 -> T6, so also T4 -> T6) depending
# on their order in change_map.
assert set(change_map).isdisjoint(change_map.values())
# 1. Update references in "select" (normal columns plus aliases),