[Django]-Django model TimeField views.py cannot select hour or minute

0👍

Seem like the date/time related lookups only works with dates and datetimes, not the time fields, although seems like it would be a nice feature to have as well.

Have you thought about raising a ticket maybe?

Maybe you can consider this as a replacement:

DEVICESCHEDULE.objects.extra(where=['SUBSTR(time, 1, 2)=%0.2d'], params=[nowHour])
DEVICESCHEDULE.objects.extra(where=['SUBSTR(time, 4, 2)=%0.2d'], params=[nowMinute])

Leave a comment