Django, Cannot assign None, does not allow null values

前端 未结 2 698
孤城傲影
孤城傲影 2021-02-14 02:03

i have this models.py

import datetime
from django.db import models
from tinymce import models as tinymce_models
from filebrowser.fields import FileBrowseField

c         


        
2条回答
  •  天命终不由人
    2021-02-14 02:23

    You need to add the parameters "null=True, blank=True" to the definition of published, that way it won't be created as a NOT NULL column in the database:

    published = models.DateField('Published', null=True, blank=True)
    

提交回复
热议问题