mirror of
https://github.com/django/django.git
synced 2025-08-25 19:29:14 +00:00
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.
This commit is contained in:
parent
b3166e1e15
commit
836894f27a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user