﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
1056	auto_now_add=True broken with ChangeManipulator	GomoX <gomo@…>	nobody	"This is from the current DateField definition (django/core/meta/fields.py):
{{{
#!python
def pre_save(self, value, add):
    if self.auto_now or (self.auto_now_add and add):
        return datetime.datetime.now()
    return value
}}}

When you modify an object that has this field using it's ChangeManipulator, the field gets set to ""null"" from the request, because the DateTime fields with auto_now_add=True or auto_now=True are not editable (line 387 of the same file).
An additional elif clause should be added to catch this problem, like this:
{{{
#!python
def pre_save(self, value, add):
    if self.auto_now or (self.auto_now_add and add):
        return datetime.datetime.now()
    elif self.auto_now_add:
        return the_current_value_from_the_db
    else:
        return value
}}}

I'm posting the ticket instead of a patch because I'm not sure how to get the current value from the DB from the field instance."	defect	closed	contrib.admin		major	fixed		gomo@…	Accepted	0	0	0	0	0	0
