Fixed #36288 -- Addressed improper handling of duplicates in values_list().

Now that selected aliases are stored in sql.Query.selected: dict[str, Any]
the values_list() method must ensures that duplicate field name references are
assigned unique aliases.

Refs #28900.

Regression in 65ad4ade74.

Thanks Claude for the report.
This commit is contained in:
Simon Charette 2025-04-02 18:53:36 -04:00 committed by Sarah Boyce
parent 2d1ac1dce8
commit 21f8be76d4
4 changed files with 35 additions and 16 deletions

View file

@ -32,3 +32,7 @@ Bugfixes
* Fixed a regression in Django 5.2 that caused a crash when using
``QuerySet.select_for_update(of=(…))`` with ``values()/values_list()``
including expressions (:ticket:`36301`).
* Fixed a regression in Django 5.2 that caused improper values to be returned
from ``QuerySet.values_list()`` when duplicate field names were specified
(:ticket:`36288`).