diff options
| author | Simon Charette <charette.s@gmail.com> | 2025-05-06 09:07:55 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2025-08-23 18:09:43 +0200 |
| commit | 836894f27a0e2c32dbbecbe8392ba7d4d0d17d8a (patch) | |
| tree | b831b56c1124b0f41c197c694bb17d5836eaad60 /django | |
| parent | b3166e1e15824aedb7a609dfda18ef36ea023d06 (diff) | |
Refs #470 -- Adjusted Field.db_returning to be backend agnostic.
Determining if a field is db_returning based on the default connection
feature availability prevents the usage of RETURNING for db_default
fields in setups where non-default backends do support RETURNING.
Whether or not the field should be attempted to be returned is already
checked at the compiler level which is backend aware.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index e7add282a6..ee7a30cc30 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -932,9 +932,7 @@ class Field(RegisterLookupMixin): @property def db_returning(self): """Private API intended only to be used by Django itself.""" - return ( - self.has_db_default() and connection.features.can_return_columns_from_insert - ) + return self.has_db_default() def set_attributes_from_name(self, name): self.name = self.name or name |
