标签:datetime mode color 现在 publish 类型 published field 应该
有一个model的字段是 DateTimeField
,我现在要具体查询某一天date
的数据,应该怎么用orm来查询呢?
YourModel.objects.filter(datetime_published__year=‘2008‘, datetime_published__month=‘03‘, datetime_published__day=‘27‘)
YourModel.objects.filter(your_datetime_field__startswith=datetime.date(2009,8,22))
Mymodel.objects.filter(date_time_field__contains=datetime.date(1986, 7, 28))
标签:datetime mode color 现在 publish 类型 published field 应该
原文地址:https://www.cnblogs.com/zhaoyingjie/p/9669632.html