[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateRangeIndex - DateRangeIndex.py:1.6

Sidnei da Silva sidnei@x3ng.com.br
Tue, 17 Jun 2003 15:01:37 -0400


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/DateRangeIndex
In directory cvs.zope.org:/tmp/cvs-serv17889/lib/python/Products/PluginIndexes/DateRangeIndex

Modified Files:
	DateRangeIndex.py 
Log Message:
 - Made all PluginIndexes and ZCTextIndex use 'safe_callable',
        which is aware of extension classes that fill 'tp_callable'
        but don't define '__call__'.

      - Made KeywordIndex be more robust about receiving a value that
        is not a string or an iterable type.

=== Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py 1.5 => 1.6 ===
--- Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py:1.5	Thu Dec  5 16:35:52 2002
+++ Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py	Tue Jun 17 15:01:06 2003
@@ -14,9 +14,12 @@
 """$Id$
 """
 
+import os
+
 from Products.PluginIndexes import PluggableIndex
 from Products.PluginIndexes.common.UnIndex import UnIndex
 from Products.PluginIndexes.common.util import parseIndexRequest
+from Products.PluginIndexes.common import safe_callable
 from OFS.SimpleItem import SimpleItem
 
 from BTrees.IOBTree import IOBTree
@@ -25,7 +28,6 @@
 from Globals import package_home, DTMLFile, InitializeClass
 from AccessControl import ClassSecurityInfo
 from DateTime.DateTime import DateTime
-import os
 
 _dtmldir = os.path.join( package_home( globals() ), 'dtml' )
 
@@ -158,12 +160,12 @@
             return 0
 
         since = getattr( obj, self._since_field, None )
-        if callable( since ):
+        if safe_callable( since ):
             since = since()
         since = self._convertDateTime( since )
 
         until = getattr( obj, self._until_field, None )
-        if callable( until ):
+        if safe_callable( until ):
             until = until()
         until = self._convertDateTime( until )