Fixed #126 - Deprecates microsecond indexing.

This commit is contained in:
Jorge C. Leitão 2014-05-18 09:09:12 +02:00
parent b623ea2556
commit 1c3a7ff4a5
2 changed files with 4 additions and 11 deletions

View file

@ -453,7 +453,6 @@ class XapianSearchBackendTestCase(HaystackBackendTestCase, TestCase):
self.assertEqual(_marshal_value(datetime.datetime(2009, 5, 9, 16, 14)), '20090509161400')
self.assertEqual(_marshal_value(datetime.datetime(2009, 5, 9, 0, 0)), '20090509000000')
self.assertEqual(_marshal_value(datetime.datetime(1899, 5, 18, 0, 0)), '18990518000000')
self.assertEqual(_marshal_value(datetime.datetime(2009, 5, 18, 1, 16, 30, 250)), '20090518011630000250')
def test_build_schema(self):
search_fields = connections['default'].get_unified_index().all_searchfields()

View file

@ -1342,16 +1342,10 @@ def _marshal_date(d):
def _marshal_datetime(dt):
if dt.microsecond:
return '%04d%02d%02d%02d%02d%02d%06d' % (
dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second, dt.microsecond
)
else:
return '%04d%02d%02d%02d%02d%02d' % (
dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second
)
return '%04d%02d%02d%02d%02d%02d' % (
dt.year, dt.month, dt.day, dt.hour,
dt.minute, dt.second
)
class XapianEngine(BaseEngine):