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

Sidnei da Silva sidnei@x3ng.com.br
Tue, 17 Jun 2003 14:14:57 -0400


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

Modified Files:
      Tag: Zope-2_6-branch
	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.4 => 1.4.6.1 ===
--- Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py:1.4	Wed Aug 14 18:19:28 2002
+++ Zope/lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py	Tue Jun 17 14:14:25 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' )
 
@@ -156,12 +158,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 )