diff options
| author | Simon Charette <charette.s@gmail.com> | 2025-01-09 00:29:58 -0500 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-01-09 17:38:42 +0100 |
| commit | af6336f2c82fd6e5a0e42a7650a3a132c3362a0f (patch) | |
| tree | c1dfad68fd96134a4054b7f006f8736fd18adb08 /django | |
| parent | fc28550fe4e0582952993976edc62971bd5345a8 (diff) | |
Fixed #36074 -- Excluded composite primary key fields on save() updates.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py index a7a26b405c..6d66080c20 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -1091,10 +1091,11 @@ class Model(AltersData, metaclass=ModelBase): for a single table. """ meta = cls._meta + pk_fields = meta.pk_fields non_pks_non_generated = [ f for f in meta.local_concrete_fields - if not f.primary_key and not f.generated + if f not in pk_fields and not f.generated ] if update_fields: |
