My model is:
class Report(models.Model):
created = models.DateTimeField(auto_now_add=True)
My views is:
def filter_range(request):
results = Report.objects.filter(created__range=['2012/01/09 00:00','2012/01/11 23:59'])
return render_to_response("log/filter.html", {'results':results})
It gives the error:
Exception Type: ValidationError
Exception Value: [u'Enter a valid date/time in YYYY-MM-DD HH:MM[:ss[.uuuuuu]] format.']
What could be wrong? Thank you.
have you read the error message?
2012/01/09is not in the formtYYYY-MM-DD(slashes aren’t dashes)