﻿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
23215	Warning: Field 'id' doesn't have a default value	Eduardo Klein	nobody	"This is a problem that I don't have with django 1.7.b4, but I do have it with 1.7c2.

I have a model like this:

{{{
class Image(models.Model):
    id = models.AutoField(primary_key=True)
    datetime = models.DateTimeField(default=datetime.now)
    file = models.FileField()
    #some other fields
}}}


At some point of my code, I do:

{{{
image = Image()
...
image.file.save(filename, file_content)
image.save()
}}}

This works fine with django 1.7.b4, but gives the following error (even if it says warning):
""Field 'id' doesn't have a default value""

My db backend is MySQL.

This seems to be a bug, since I did not find anything in the release notes that says that this was not possible in django 1.7

I have tried to create a test model to reproduce the problem, but all the tests I made with the 3 fields above only passed (no errors). There must be some specific condition in my model that makes it fails.

Since you know what has changed from 1.7.b4 to 1.7c2, do yoy know or have an idea of what maybe happening. If you give me directions on what have changed, I can make more tests to reproduce the bug.
"	Bug	closed	Database layer (models, ORM)	1.7-rc-2	Normal	needsinfo	model default value	cmawebsite@…	Unreviewed	0	0	0	0	0	0
