Of course, I can't speak for what the core dev's official opinion is
of them, but they are all in the middle of DjangoCon this week and
generally not checking their email. Thus the quiet on the lists.
You'll have to wait a few days for more. Regardless, I think you may
be dwelling on some old, outdated info.
[1]: http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.DateField
--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
> I'm trying to give advice to people but I can't even figure it out
> myself (even though it works for me just fine -- so far?).
Last week, I ran into a problem using them because I wanted to set manually
the date in certain situations. auto_now sets it to datetime.datetime.now()
*everytime* it's saved, which means you can't actually set it manually. Thus,
you have to be careful, and overriding save() may be a better option in some
cases.
Since auto_now uses datetime.datetime.now() I don't know if it's
tangential or relevant to point to another article that discusses some
unexpected behaviour of datetime. It says "datetime.now() is never to
be used. Always use datetime.utcnow()":
http://www.enricozini.org/2009/debian/using-python-datetime/
I've not investigated this to any degree so I'm just passing it on as
a potentially relevant sidenote.
Nick
I don't understand what you mean by "changed since then" as that
article was "Last edited Thu 25 Jun 2009". I was referring
specifically to /db/models/fields/__init__.py line 888:
value = datetime.datetime.now()
As you say, datetime.now() takes timezone as an optional parameter,
but it has done for years. From my reading of that article the
statement "datetime.now() is never to be used. Always use
datetime.utcnow()" means the above line would become:
value = datetime.datetime.utcnow()
I'm not and cannot argue for or against that idea due to my poor
knowledge of Python, it's date libraries and the whole timezone issue
in general so I'm really just wondering if that has any relevance?
Thanks to the original poster I'm now also interested in whether and
if so why, auto_now and auto_now_add are to be avoided.
Nick