9
我想跟随在我修改以下如何让我的模型字段在Django中可选?
date_of_birth = models.DateField(null=True)
的
https://docs.djangoproject.com/en/dev/topics/auth/customizing/
在我的模型底部的完整的例子。然而,当我尝试注册一个用户我仍然得到以下错误消息:
date_of_birth <ul class="errorlist"><li>This field is required.</li></ul>
在什么其他地方我需要使date_of_birth可选?
如果blank = True,会发生什么情况,但您将null保留为false? (假设false是默认值) –