#26239: Document auto_now behavior with QuerySet.update()
-------------------------------+--------------------
     Reporter:  boussouira     |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Documentation  |    Version:  1.8
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 I don't know if this is a bug or not, but when using `update()`, the
 DateTime fields with `auto_now` are not updated to the current time. The
 documentation of `auto_now` doesn't say anything about that situation.
 For example:

 {{{
 #  This won't update `updated_at`:
 Order.objects.filter(user_id=7).update(check_count=3)

 # You have to explicitly include it in update()
 Order.objects.filter(user_id=7).update(check_count=3,
 updated_at=timezone.now())
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26239>
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/053.47ae7ca09954bfc936780b90e5d284da%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to