django ?????Χ????????
???????????? ???????[ 2013/12/2 10:34:04 ] ????????
??????????????????? date_from ??date_to??????????????????????__range???????????????????????????????
import datetime
def filter(request):
if 'year_from' and 'month_from' and 'day_from' and
'year_to' and 'month_to' and 'day_to' in request.GET:
y = request.GET['year_from']
m = request.GET['month_from']
d = request.GET['day_from']
date_from = datetime.datetime(int(y)?? int(m)?? int(d)?? 0?? 0)
y = request.GET['year_to']
m = request.GET['month_to']
d = request.GET['day_to']
date_to = datetime.datetime(int(y)?? int(m)?? int(d)?? 0?? 0)
book_list = book.objects.filter(date__range=(date_from?? date_to))
print book_list
else:
print "error time range!"
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11