Changes between Initial Version and Version 1 of Ticket #37238
- Timestamp:
- Jul 28, 2026, 3:10:58 PM (62 minutes ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #37238
- Property Summary 6.1: save() falls back to db_default for primary key that should come from related instance instead → 6.1: save() falls back to python default for primary key that should come from related instance instead
-
Ticket #37238 – Description
initial v1 1 When saving an object whose primary key is a `OneToOneField`, and when that value is meant to come from an unsaved related object, a 2348c85fc6c20087935c74cd99340dd4ef2dcdc has the unintentional effect of falling back to the field's `db_default` instead of getting it from the related object once saved.1 When saving an object whose primary key is a `OneToOneField`, and when that value is meant to come from an unsaved related object, and when that related object uses `db_default`, a2348c85fc6c20087935c74cd99340dd4ef2dcdc has the unintentional effect of falling back to the field's `default` instead of getting it from the related object once saved. 2 2 3 3 To demonstrate, adjust a test being drafted in this [https://github.com/django/django/pull/21677 other PR] (where the `bulk_create()` case was considered and handled) to use `save()` instead: