﻿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
28951	loaddata from fixture doesn't work with null=False auto_now_add fields	Stephan Doliov	nobody	"for a model

from django.db import models


{{{
class Foo(models.Model):
    name = models.TextField(max_length=256,null=False)
    created = models.DateTimeField(auto_now_add=True,null=False)
}}}

and a fixture file foo_data.json
{{{
[
    {
        ""model"": ""app.Foo"",
        ""pk"": 1,
        ""fields"": {
            ""name"": ""Foo is fun""
        }
    }
]
}}}

{{{
./manage.py load_data fixtures/foo_data.json
}}}
fails, as expected because the fixture is loaded as raw.

This is annoying however to mock up a fixture file (especially a long one used for exercising hundreds of test cases) with manufactured timestamps.

What are the benefits/drawbacks of modifying the loaddata routine to respect the creation of auto_now_add values, and possibly auto_now values?"	Uncategorized	closed	Uncategorized	2.0	Normal	wontfix	loaddata auto_now_add fixtures		Unreviewed	0	0	0	0	0	0
