Thanks!

Ok, I see that the problem is more complicated than I thought, so I'll
leave it that way.

I just want to add that if you decide that you don't like the current
behaviour, you can always use FutureWarning, to first warn if a value
was set and is about to be discarded, and then change the behaviour.

Have a good day,
Noam

On 7/5/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> On 7/5/07, Noam <[EMAIL PROTECTED]> wrote:
> >
> > The conclusion is that auto_now_add should set the date only if it is
> > None. Or, another solution: it should set the date upon instance
> > creation, not upon saving.
>
> FYI - this is a known problem, with scope and ramifications much
> larger than the problem you have identified. It also affects any model
> with a customized save() method, and is a major problem for accurate
> data serialization, which in turn is a problem for testing.
>
> The problem is logged as #4459; I'm hoping to spend some time fixing
> this in the near future.
>
> Neither of the solutions you propose are viable - as others have
> noted, the first is backwards incompatible, the second would make
> auto_now_add equivalent to auto_now.
>
> The best solution I can think of (and the solution that will probably
> get implemented, unless a better solution is proposed) is to add a
> 'preprocess=True' default argument to the save() method of a model.
> Default behaviour will be unaffected; however, if you call
> model.save(preprocess=False),  Django will skip the pre-processing
> steps that modify dates and do other forms of database coercion. This
> will allow serialization to force a literal interpretation of input
> data, and would fix your problem as well.
>
> Yours
> Russ Magee %-)
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to