#34099: update_or_create() not saving data assigned in a model's save() method
-------------------------------------+-------------------------------------
     Reporter:  Phil Gyford          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Sarah Boyce):

 I guess we would also have this problem if any fields are set on a
 pre_save signal.

 Adding to the update_fields when overwriting a model save is good practise
 but I admit I have never thought about it, maybe we should add a
 note/example here: https://docs.djangoproject.com/en/4.1/topics/db/models
 /#overriding-predefined-model-methods

 If we chose to keep the commit, maybe we add update_fields in the boiler
 plate code here:
 https://docs.djangoproject.com/en/4.1/ref/models/querysets/#update-or-
 create
 I am also ok with dropping the commit.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34099#comment:3>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/01070183dafa1d36-b0e261a3-2908-4453-b024-1116f2008c08-000000%40eu-central-1.amazonses.com.

Reply via email to