#30319: model.save() surprising behavior with update_fields specified and 
auto_now
field in model
-------------------------------------+-------------------------------------
     Reporter:  sebhaase             |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  closed
    Component:  Database layer       |                  Version:  2.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 It sounds quite clear for me that if you add fields with `auto_now` flag
 to the list of `updated_fields` then its value will be updated. Due to the
 different behavior with and without PK please check
 [https://docs.djangoproject.com/en/dev/ref/models/instances/#how-django-
 knows-to-update-vs-insert how-django-knows-to-update-vs-insert]. IMO
 documentation doesn't require clarification here.

 If you have other support questions please see
 [https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
 TicketClosingReasons/UseSupportChannels] for ways to get help with Django
 usage (and yes I've seen that you've already posted on django-users).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30319#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.c45158a2a179c3776ff1dc1ac92c3585%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to