django/tests/delete_regress
Simon Charette 28e2077148 Refs #32433 -- Reallowed calling QuerySet.delete() after distinct().
While values(*field_excluding_pk).distinct() and
distinct(*field_excluding_pk) can reduce the number of resulting rows
in a way that makes subsequent delete() calls ambiguous standalone
.distinct() calls cannot.

Since delete() already disallows chain usages with values() the only
case that needs to be handled, as originally reported, is when
DISTINCT ON is used via distinct(*fields).

Refs #32682 which had to resort to subqueries to prevent duplicates in
the admin and caused significant performance regressions on MySQL
(refs #34639).

This partly reverts 6307c3f1a1.
2023-07-07 07:08:28 +02:00
..
__init__.py Removed unneeded imports in tests's __init__.py and unified them. 2013-09-09 23:01:07 +02:00
models.py Fixed #33928 -- Avoided unnecessary queries when cascade updating. 2022-08-27 14:25:55 +02:00
tests.py Refs #32433 -- Reallowed calling QuerySet.delete() after distinct(). 2023-07-07 07:08:28 +02:00