我的一个Django模型中有一个DateTimeField。
completed_date = models.DateTimeField('date completed', blank=True, null=True)
我将其定义为允许空白和空值。但是,当我尝试创建模型的实例时,会出现以下错误:
IntegrityError at /admin/tasks/project/add/
tasks_project.completed_date may not be NULL
我使用的是Django 1.25和Python 2.7。有人知道为什么会这样吗?我能做些什么来解决这个问题吗?
我发现了一个ticket that describes the same problem,但它在4年前就已经关闭了,所以我想它现在一定已经集成到Django中了!
django syncdb and an updated model
从这个问题/答案:
^{}
相关问题 更多 >
编程相关推荐