update_or_create automatic addition of fields to update_fields

20 views
Skip to first unread message

Mathieu Zonzon

unread,
Jun 7, 2024, 3:42:44 PMJun 7
to Django developers (Contributions to Django itself)
Hi,

update_or_create adds auto_now fields to the update_fields passed to the model save in case of an update.
However, it also adds any field overriding Field.pre_save() method. As a consequence any DateField will be added to update_field even if it is not an auto_now.
Should the addition of fields to the update_fields be more restrictive and be limited to the auto_now and auto_now_add fields?

Regards,

Mathieu
Reply all
Reply to author
Forward
0 new messages