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

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


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

Modified Files:
	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.11 => 1.12 ===
--- Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py:1.11	Sun Jun  8 04:56:28 2003
+++ Zope/lib/python/Products/PluginIndexes/DateIndex/DateIndex.py	Tue Jun 17 15:01:06 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
@@ -63,7 +64,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 )