#26239: Document auto_now behavior with QuerySet.update()
--------------------------------------+------------------------------------
Reporter: boussouira | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by AMaini503):
Replying to [ticket:26239 boussouira]:
> 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())
> }}}
--> I will try to work on this. But should update be modified to include
timestamp by itself or documentation should be altered to state that
timestamp needs to be passed explicitly ?
--
Ticket URL: <https://code.djangoproject.com/ticket/26239#comment:2>
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/068.2d95e7a7fee0f03398034f362e6e3f2e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.