﻿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
1030	auto_now_add is broken for edit_inline field	titoo	nobody	"Considering the following models:

{{{
from django.core import meta

class Testcontact(meta.Model):
    name = meta.CharField(maxlength=100)
    birth_date = meta.DateField(blank=True, null=True)
    time_added = meta.DateTimeField(auto_now_add=True)
    time_modified = meta.DateTimeField(auto_now=True)

    def __repr__(self):
        return self.name

    class META:
        admin = meta.Admin()

class Testaddress(meta.Model):
    email = meta.EmailField(core=True)
    time_added = meta.DateTimeField(auto_now_add=True)
    time_modified = meta.DateTimeField(auto_now=True)
    contact = meta.ForeignKey(Testcontact, edit_inline=meta.STACKED, min_num_in_admin=2)

    def __repr__(self):
        return self.email
}}}

When adding a ""contact"" as long as no emails are provided, everything is fine. Then if you add an email, the first save is ok, the second one will return an error: 

Request Method:  	POST [[BR]]
Request URL: 	http://127.0.0.1:8000/admin/testcase/testcontacts/1/ [[BR]]
Exception Type: 	OperationalError [[BR]]
Exception Value: 	testcase_testaddresss.time_added may not be NULL [[BR]]
Exception Location: 	/usr/lib/python2.4/site-packages/django/core/db/backends/sqlite3.py in execute, line 71 [[BR]]

As shown the backend is sqlite, django revision 1568.
"	defect	closed	contrib.admin	dev	major	invalid		ibonso@… brice.carpentier@… bray@… djangodev@… root.lastnode@… pete.crosier@… bjorn@… chengqi@… gary.wilson@… jyrki.pulliainen@… matt.barry@… brooks.travis@… smoonen@…	Accepted	1	0	1	1	0	0
