#27222: Refresh fields that are expressions after Model.save()
-------------------------------------+-------------------------------------
Reporter: holvianssi | Owner: Simon
| Charette
Type: New feature | Status: closed
Component: Database layer | Version: 1.10
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):
In [changeset:"77b306ea0fea54ed440a369dc38161331602386c" 77b306ea]:
{{{#!CommitTicketReference repository=""
revision="77b306ea0fea54ed440a369dc38161331602386c"
[6.0.x] Fixed #36847 -- Ensured auto_now_add fields are set on pre_save().
Regression in 94680437a45a71c70ca8bd2e68b72aa1e2eff337. Refs #27222.
During INSERT operations, `field.pre_save()` is called to prepare values
for db insertion. The `add` param must be `True` for `auto_now_add`
fields to be populated. The regression commit passed `False`, causing
`auto_now_add` fields to remain `None` when used by other fields, such
as `upload_to` callables.
Thanks Ran Benita for the report.
Backport of fe189dc43ab3eddbbceefb6834893b73ca60d5ed from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27222#comment:22>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019c09fb502a-f2335dbe-8f55-432b-b9bf-cba3e2aae5a8-000000%40eu-central-1.amazonses.com.