[Answer]-Comparing datetime field in python, not just date or time , Type Error :Can't compare unicode to date.datetime field

1👍

Use attributes in form.cleaned_data to compare. Attributes in cleaned_data will be of appropriate data type.

e.g.

if form.is_valid():
   if form.cleaned_data['time']==datetime.datetime.min:
   ....
👤Rohan

Leave a comment