Sunday, July 27, 2014

Re: Why are DateTimeField auto_now and auto_now_add bad?


I'm not aware of a formally documented list anywhere. 

To the best my knowledge, the bug/downside that is referred to here is that the fields *won't* automatically update in *every* circumstance. You need to actually *save* the model to make the field update. Calls to update, save_base, etc won't invoke the "auto" part of the field logic, and the timestamp won't be adjusted.

Yours,
Russ Magee %-)


On Sun, Jul 27, 2014 at 10:29 PM, Mattias Linnap <linnap@gmail.com> wrote:
Hi all,

I've seen DateTimeField's auto_now and auto_now_add parameters often described as "buggy" or "error-prone". For example:

The ticket proposes to document these downsides or problems in more detail. But until that happens, is there a blog post or mailing list post somewhere that summarises the gotchas to watch out for with auto_now?

Thanks,

Mattias

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d61eca2-21c7-41ae-a921-a448d5f9f4f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJxq848229xCPoCKQ1KpayYqiTK4Wfr4wascb4h66JwyPGKOdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment