1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #27222 -- Refreshed model field values assigned expressions on save().

Removed the can_return_columns_from_insert skip gates on existing
field_defaults tests to confirm the expected number of queries are
performed and that returning field overrides are respected.
This commit is contained in:
Simon Charette
2025-03-19 01:39:19 -04:00
committed by Mariusz Felisiak
parent 55a0073b3b
commit 94680437a4
7 changed files with 123 additions and 63 deletions

View File

@@ -331,7 +331,8 @@ Models
value from the non-null input values. This is supported on SQLite, MySQL,
Oracle, and PostgreSQL 16+.
* :class:`~django.db.models.GeneratedField`\s are now refreshed from the
* :class:`~django.db.models.GeneratedField`\s and :ref:`fields assigned
expressions <avoiding-race-conditions-using-f>` are now refreshed from the
database after :meth:`~django.db.models.Model.save` on backends that support
the ``RETURNING`` clause (SQLite, PostgreSQL, and Oracle). On backends that
don't support it (MySQL and MariaDB), the fields are marked as deferred to