标签:flow roc webkit content button pretty 查询 tap rgba
有一个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))
参考:How can I filter a date of a DateTimeField in Django?
标签:flow roc webkit content button pretty 查询 tap rgba
原文地址:https://www.cnblogs.com/hichens/p/13037467.html