How to make Django's DateTimeField optional?

后端 未结 3 1954
野趣味
野趣味 2020-12-13 11:50

I am trying to implement a to-do-list website to practice using Django. In models.py, I have a class called Item to represent a to-do item. In it, I have the fo

3条回答
  •  萌比男神i
    2020-12-13 12:42

    "required" is a valid argument for Django forms. For models, you want the keyword args blank=True (for the admin) and null=True (for the database).

提交回复
热议问题