#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 Phil Gyford):

 I must admit that in all the years I've been overriding `save()` methods
 and using `update_or_create()` without any problems (and checking the docs
 a lot because my memory is terrible) I've never even been aware of
 `update_fields`.

 I guess I'm not alone – I just looked through my first 30 google results
 for "django override save site:stackoverflow.com" and only one of them
 used `update_fields`, and that was a question explicitly about it. (Not
 all of the results were about updating the model's own fields but that
 seems the most common use case.)

 So, at a bare minimum, updating the docs for those two methods would be
 great, as Sarah Boyce suggests.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34099#comment:4>
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/01070183db2310b6-2e232eb3-5f10-443a-9f1e-2bb37e449fc4-000000%40eu-central-1.amazonses.com.

Reply via email to