﻿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
25528	`FileField(null=True)` doesn't work as expected	Tai Lee	nobody	"Given this model:

{{{
class Foo(models.Model):
    foo_file = models.FileField(null=True)
}}}

which allows null values, if I create a foo object, the `foo_file` field appears to be `None` by default, as I would expect. But on save, it is converted to an empty string:

{{{
>>> f = Foo()

>>> f.foo_file.name == ''
False

>>> f.foo_file.name == None
True

>>> f.save()
>>> f = Foo.objects.get()

>>> f.foo_file == ''
True
}}}

This is both unexpected, and also makes `null=True` a bit pointless for `FileField`.

If it is really by design that file fields cannot be null, setting `null=True` on the field should be an error and the field should have `default=''` by default. Although I think it would be better for `FileField(null=True)` to work more like other fields.
"	Uncategorized	closed	Database layer (models, ORM)	1.8	Normal	duplicate	FileField null empty string		Unreviewed	0	0	0	0	0	0
