[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/DateIndex - DateIndex.py:1.7.6.2

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


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

Modified Files:
      Tag: Zope-2_6-branch
	DateIndex.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/DateIndex/DateIndex.py 1.7.6.1 => 1.7.6.2 ===
--- Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py:1.7.6.1	Sun Jun  8 04:52:50 2003
+++ Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py	Tue Jun 17 14:14:25 2003
@@ -14,11 +14,12 @@
 """$Id$
 """
 
+from types import StringType, FloatType, IntType
 from DateTime.DateTime import DateTime
 from Products.PluginIndexes import PluggableIndex
 from Products.PluginIndexes.common.UnIndex import UnIndex
 from Products.PluginIndexes.common.util import parseIndexRequest
-from types import StringType, FloatType, IntType
+from Products.PluginIndexes.common import safe_callable
 
 from Globals import DTMLFile
 from BTrees.IOBTree import IOBTree
@@ -62,7 +63,7 @@
 
         try:
             date_attr = getattr( obj, self.id )
-            if callable( date_attr ):
+            if safe_callable( date_attr ):
                 date_attr = date_attr()
 
             ConvertedDate = self._convert( value=date_attr, default=_marker )