1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #19580 -- Unified behavior of reverse foreign key and many-to-many relations for unsaved instances.

This commit is contained in:
Albert Defler
2022-01-14 12:44:17 +00:00
committed by Mariusz Felisiak
parent b7f263551c
commit 7ba6ebe914
5 changed files with 80 additions and 8 deletions

View File

@@ -375,6 +375,14 @@ this difference. In Django 4.0 and earlier,
second example query, but this undocumented behavior led to queries with
excessive joins.
Reverse foreign key changes for unsaved model instances
-------------------------------------------------------
In order to unify the behavior with many-to-many relations for unsaved model
instances, a reverse foreign key now raises ``ValueError`` when calling
:class:`related managers <django.db.models.fields.related.RelatedManager>` for
unsaved objects.
Miscellaneous
-------------