I am sending two date values over request.GET for filtering a querySet:
if 'from_date' in request.GET:
from_date = request.GET['from_date']
if 'to_date' in request.GET:
to_date = request.GET['to_date']
else:
to_date = datetime.date.today()
calls_queryset = calls_queryset.filter(contact_date__range=(from_date, to_date))
The filter__range breaks though. It seems it doesn't like the date format I am sending over.
?from_date=08/08/2012&to_date=08/29/2012
I think I have to cast them to be a date before placing them in range, is this correct? What is the most efficient way to do this?
Many Thanks