﻿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
28671	DateTimeField: make auto_now_add just a default value	Дилян Палаузов	nobody	"Providing there is no strong reason to threat auto_now_add as something different than a default value, that cannot be overridden, here is a patch permitting to set the auto_now_add:

{{{
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -1272,7 +1272,7 @@ class DateField(DateTimeCheckMixin, Field):
         )
 
     def pre_save(self, model_instance, add):
-        if self.auto_now or (self.auto_now_add and add):
+        if self.auto_now or (self.auto_now_add and add and getattr(model_instance, self.attname, None) is None):
             value = datetime.date.today()
             setattr(model_instance, self.attname, value)
             return value
@@ -1424,7 +1424,7 @@ class DateTimeField(DateField):
         )
 
     def pre_save(self, model_instance, add):
-        if self.auto_now or (self.auto_now_add and add):
+        if self.auto_now or (self.auto_now_add and add and getattr(model_instance, self.attname, None) is None):
             value = timezone.now()
             setattr(model_instance, self.attname, value)
             return value
@@ -2264,7 +2264,7 @@ class TimeField(DateTimeCheckMixin, Field):
         )
 
     def pre_save(self, model_instance, add):
-        if self.auto_now or (self.auto_now_add and add):
+        if self.auto_now or (self.auto_now_add and add and getattr(model_instance, self.attname, None) is None):
             value = datetime.datetime.now().time()
             setattr(model_instance, self.attname, value)
             return value
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -514,9 +514,8 @@ optional arguments:
 .. attribute:: DateField.auto_now_add
 
     Automatically set the field to now when the object is first created. Useful
-    for creation of timestamps. Note that the current date is *always* used;
-    it's not just a default value that you can override. So even if you
-    set a value for this field when creating the object, it will be ignored.
+    for creation of timestamps. If you set a value for this field when creating
+    the object, auto_now_add will be ignored.
     If you want to be able to modify this field, set the following instead of
     ``auto_now_add=True``:
 
}}}"	Cleanup/optimization	closed	Database layer (models, ORM)	1.11	Normal	wontfix			Unreviewed	0	0	0	0	0	0
