[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateIndex - DateIndex.py:1.5
Chris McDonough
chrism@zope.com
Sun, 30 Jun 2002 01:45:37 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/DateIndex
In directory cvs.zope.org:/tmp/cvs-serv788
Modified Files:
DateIndex.py
Log Message:
DateIndexes were handling neither float nor int dates as values to
_apply_index or index_object.
Fixed and added test cases to unittests.
=== Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py 1.4 => 1.5 ===
from BTrees.OIBTree import OIBTree
from BTrees.IIBTree import IISet, union, intersection, multiunion
+import time
_marker = []
@@ -169,7 +170,7 @@
"""Convert Date/Time value to our internal representation"""
if isinstance( value, DateTime ):
t_tup = value.parts()
- elif type( value ) is FloatType:
+ elif type( value ) in (FloatType, IntType):
t_tup = time.gmtime( value )
elif type( value ) is StringType:
t_obj = DateTime( value )