toastdriven/django-haystack — Issue #529: Can't query datetime fields with an `__exact` query 
Author: paulswartz
Created: 2012-03-05 20:13:41+00:00
State: open

In [1]: from haystack.query import SearchQuerySet
In [2]: import datetime
In [3]: SearchQuerySet().count()
Out[3]: 576
In [5]: SearchQuerySet()[0].when_approved
Out[5]: datetime.datetime(9999, 12, 31, 23, 59, 59, 999999)
In [8]: SearchQuerySet().filter(when_approved__exact=datetime.datetime.max).count()
Out[8]: 0
In [10]: SearchQuerySet().filter(when_approved=datetime.datetime.max).count()
Out[10]: 576
In [9]: SearchQuerySet()[0].when_approved == datetime.datetime.max
Out[9]: True

Both the `__exact` query and the regular query should return the same results. This is against Haystack master and Whoosh 2.3.2.