By the way drossy, I still don't know why it's evil, just that every respected Django dev (and BDFLs) were +1 on removing it (very +1). But the reasons don't seem consistent. In one case James B. describe's some unexplained side effects of using it (which coincide with another bloggers findings) which would make the two attributes unstable. I don't know if that is just older behavior from previous releases.
Then the above discussion I found (through a link on a blog to a ticket that Google (!) can't find) says that it violates the DRY principle. Well, in my eyes, and some developers in that discussion would agree, it's just a very convenient attribute, like the render_to_response function. Anyway, I just used default for auto_now_add and created a DateTimeField sublass AutoDateTimeField which overrides pre_save and returns datetime.datetime no matter the value of the in argument "add" (auto_now) -- an example of one of the many alternative solutions suggested. It should have just been removed before 1.0 (a perfect time to do that) like it seemed they would do but it seems they opted for backward compatibility instead. At least this discussion is "findable" by Google Group's search. Cheers, Ryan On Sep 10, 1:03 pm, Ryan K <ryankas...@gmail.com> wrote: > Thank you Waylan for your comments. I've found the developer > discussion about this (searching the group for "auto_now_add" does not > find the result! wow! Google missing an easy > hit?).http://groups.google.com/group/django-developers/browse_thread/thread... > . This solves the problem sufficiently. Thanks. > > On Sep 10, 12:21 pm, drozzy <dro...@gmail.com> wrote: > > > > > Well, that is the purpose of that. I mean if you want a custom field > > that saves only on Thursday, it makes sense to write a modified save > > routine.. > > > On Sep 10, 1:19 pm, Andrew Gwozdziewycz <apg...@gmail.com> wrote: > > > > On Thu, Sep 10, 2009 at 9:35 AM, Ryan K<ryankas...@gmail.com> wrote: > > > > 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. > > > > --http://www.apgwoz.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---