title: Django ValidationError (Date)
body: <p>I have a system with a search box that searches and displays order.</p>
  
  <p>i customize the the search by making the system search by start date to end date or search by using select tag.</p>
  
  <p>Presently i i search by start-end date, it works but if i search and select from the select tag i get an error which is:</p>
  
  <pre><code>[u"'' value has an invalid format. It must be in YYYY-MM-DD HH:MM[:ss[.uuuuuu]][TZ] format."]
  </code></pre>
  
  <p>Here is my views.py</p>
  
  <pre><code>def search_form(request):
  
      data = OrderItem.objects.order_by().values_list('certification_type', flat=True).distinct()
      print data
  
      if request.method == 'GET':
          user_search = request.GET.get('searched_item')
          print "What is searched for is : ", user_search
  
          selected_tag = request.GET.get('certification_type')
          print "The selected certificate type is :", selected_tag
  
          start_date = request.GET.get('first_date')
          print "The start date is : ", start_date
  
          end_date = request.GET.get('second_date')
          print "The end date is : ", end_date
  
  
          if (user_search != None and selected_tag !=None) | (user_search != None and start_date != None and end_date != None):
              items = OrderItem.objects.filter(Q(certification_type__iexact=selected_tag) | (Q(created_on__range=(start_date , end_date))) , (Q(order_type__iexact= user_search) | Q(item__iexact= user_search)
                   | Q(certification_no__iexact= user_search) | Q(client__user__email__iexact= user_search) | Q(client__phone_number__iexact= user_search) | Q(id__iexact= user_search)))
  
  
              print "items  ",  items
              return render(request, 'i/search_results.html', {'items':items, 'user_search_query':user_search, 'selected_tag_query': selected_tag, "data":data})
  
          else:
              return render(request, 'i/dashboard.html', {'error':True,  "data":data})
  
      else:
          return render(request, 'i/dashboard.html', {'error':True,  "data":data})
  
      return render(request, 'i/search_results.html', {'items':items, 'user_search_query':user_search, 'selected_tag_query': selected_tag, "data":data})
  </code></pre>
  
  <p>The error is pointing the this line of code:</p>
  
  <pre><code>if (user_search != None and selected_tag !=None) | (user_search != None and start_date != None and end_date != None):
      items = OrderItem.objects.filter(Q(certification_type__iexact=selected_tag) | (Q(created_on__range=(start_date , end_date))) , (Q(order_type__iexact= user_search) | Q(item__iexact= user_search) | Q(certification_no__iexact= user_search) | Q(client__user__email__iexact= user_search) | Q(client__phone_number__iexact= user_search) | Q(id__iexact= user_search)))
  </code></pre>
  
  <p>am confuse, don't know what am doing wrong</p>