按日期过滤datefield给出错误“用户定义的函数引发异常”

时间:2019-06-21 05:56:55

标签: django date

当我按日期或月份或两者同时过滤DateField时:

today = date.today()
birthday = Paziente.objects.filter(natoil__month=today.month, natoil__day=today.day)

模型

class Paziente(models.Model):
    natoil = models.DateField(blank=True, null=True)

给出错误:

OperationalError at /
user-defined function raised exception

请帮助 Django 1.11.4

0 个答案:

没有答案