我正在尝试将日期字段设置为恒定日期。我的“models.py”带有日期字段:
class Foo(models.Model):
bar = models.DateField()
在我看来:
import datetime
from app.models import Foo
foo = Foo(bar=datetime.date('1/1/2021'))
错误:
Exception Type: TypeError
Exception Value: an integer is required (got type str)
最佳答案
关于python - 设置 Django 日期字段时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63722135/