Problems filtering django datetime field by month and day

前端 未结 4 851
渐次进展
渐次进展 2020-12-05 13:52

Can someone explain to me why the following filters are not working at the month and day level? Filtering by year seems to work, but not the other two.

>         


        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 14:37

    Your syntax is incorrect. It should be:

    Clicks.objects.filter(created__month=2)
    

    (you left off the 'objects' manager)

提交回复
热议问题