#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 honsdomi): Replying to [comment:2 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 ? Hello, can someone confirm if this requires modifying code or just documentation? -- Ticket URL: <https://code.djangoproject.com/ticket/26239#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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.dc10056f6ce6c9d00b21738574e14aeb%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.