python - django orm filters data whose date is today's date
淡淡烟草味
淡淡烟草味 2017-06-15 09:21:51
0
2
943

I need to implement a query to find the update time of the current day. How to use django orm to find it

    reply_list = CusQuestions.objects.filter(is_deleted='f', crt_tm ????).order_by('-crt_tm')

This is crt_tm. I don’t know how to match the date to the current day

淡淡烟草味
淡淡烟草味

reply all(2)
三叔

CusQuestions.objects.filter(crt_tm__range=["2017-06-14", "2017-06-15"])

洪涛

Depending on what type your crt_tm is, you can use the following conditions for DateTimeField and DateField types

crt_tm__gte=datetime.datetime.now().date()

If the timestamp is saved, it will be easier to handle, there is nothing to say

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!