Django, Cannot assign None, does not allow null values

前端 未结 2 639
孤城傲影
孤城傲影 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:22

     #for sql 'now()' value use
     published = models.DateField('Published', auto_now_add=True)
     #to allow sql null
     published = models.DateField('Published', null=True, blank=True)
    

提交回复
热议问题