[zopeorg-checkins] CVS: Products/DateIndexes - DateRangeIndex.py:1.6

Martijn Pieters mj at zope.com
Mon Mar 11 15:16:37 EST 2002


Update of /cvs-zopeorg/Products/DateIndexes
In directory cvs.zope.org:/tmp/cvs-serv23886

Modified Files:
	DateRangeIndex.py 
Log Message:
Fix adding of DateRangeIndexes



=== Products/DateIndexes/DateRangeIndex.py 1.5 => 1.6 ===
     since_field = until_field = None
 
-    def __init__( self, id, since_field=None, until_field=None ):
+    def __init__(self, id, since_field=None, until_field=None,
+            caller=None, extra=None):
 
-        self._setId( id )
-        self._edit( since_field, until_field )
+        if extra:
+            since_field = extra.since_field
+            until_field = extra.until_field
+
+        self._setId(id)
+        self._edit(since_field, until_field)
         self.clear()
 
     security.declareProtected( VIEW_PERMISSION
@@ -375,20 +380,11 @@
 
 addDateRangeIndexForm = DTMLFile( 'dri_add', _dtmldir )
 
-def addDateRangeIndex( self
-                     , id
-                     , REQUEST=None
-                     , RESPONSE=None
-                     , URL3=None
-                     ):
+def addDateRangeIndex(self, id, extra=None,
+        REQUEST=None, RESPONSE=None, URL3=None):
     """
         Add a date range index to the catalog, using the incredibly icky
         double-indirection-which-hides-NOTHING.
     """
-    return self.manage_addIndex( id
-                               , 'DateRangeIndex'
-                               , extra=None
-                               , REQUEST=REQUEST
-                               , RESPONSE=RESPONSE
-                               , URL1=URL3
-                               )
+    return self.manage_addIndex(id, 'DateRangeIndex', extra,
+        REQUEST, RESPONSE, URL3)





More information about the zopeorg-checkins mailing list