﻿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
12753	Fixture loading can fails on second syncdb when auto_now_add field is ommitted	Russell Keith-Magee	Karen Tracey	"Via Andrew Turner, on django-users:

Here is a simple initial_data.json:-
{{{
[
   {
       ""model"": ""posts.entry"",
       ""pk"": 1,
       ""fields"": {
           ""content"": ""This is the content""
       }
   }
]
}}}

And here is my models.py:-
{{{
from django.db import models

class Entry(models.Model):
   content = models.CharField(max_length=250)
   pub_date = models.DateTimeField(auto_now_add=True, editable=False)
}}}

First time syncdb is run, the fixture is correctly loaded, subsequent
runs result in the aforementioned error. Tested on Django 1.1.1 and
1.2alpha.
----
Comment by russellm:

The initial syncdb shouldn't be succeeding - for some reason, the field is being populated with a default value generated by the auto_now_add handling. The second syncdb gives the correct error due to the missing pub_date data in the fixture."	Bug	closed	Core (Serialization)	1.4-beta-1	Release blocker	fixed		bas@… anssi.kaariainen@… vsafronovich	Accepted	1	0	0	0	0	0
