[CMF-checkins] CVS: Products/CMFCore - FSZSQLMethod.py:1.6.12.1

Jens Vagelpohl jens at dataflake.org
Wed Apr 6 07:20:15 EDT 2005


Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv13172/CMFCore

Modified Files:
      Tag: CMF-1_5-branch
	FSZSQLMethod.py 
Log Message:
- CMFCore.FSZSQLMethod: Added configuration parameters that were left out.
  Some of the configuration parameters to ZSQL methods, specifically
  those describing custom pluggable brains classes and the
  connection_hook, were not implemented in FSZSQLMethod. Also added a
  first small unittest module for FSZSQLMethod testing.
  (http://www.zope.org/Collectors/CMF/335)


=== Products/CMFCore/FSZSQLMethod.py 1.6 => 1.6.12.1 ===
--- Products/CMFCore/FSZSQLMethod.py:1.6	Sun May 16 11:50:41 2004
+++ Products/CMFCore/FSZSQLMethod.py	Wed Apr  6 07:19:45 2005
@@ -64,8 +64,9 @@
         s.manage_advanced(self.max_rows_,
                           self.max_cache_,
                           self.cache_time_,
-                          '',
-                          '')
+                          self.class_name_,
+                          self.class_file_,
+                          connection_hook=self.connection_hook)
         return s
 
     def _readFile(self, reparse):
@@ -88,28 +89,32 @@
             if len(pair)!=2:
                 continue
             parameters[pair[0].strip().lower()]=pair[1].strip()
-
-        # check for required an optional parameters
+        
+        # check for required parameters
         try:
-            title =         parameters.get('title','')
-            connection_id = parameters.get('connection id',parameters['connection_id'])
-            arguments =     parameters.get('arguments','')
-            max_rows =      parameters.get('max_rows',1000)
-            max_cache =     parameters.get('max_cache',100)
-            cache_time =    parameters.get('cache_time',0)
+            connection_id =   ( parameters.get('connection id', '') or
+                                parameters['connection_id'] )
         except KeyError,e:
             raise ValueError,"The '%s' parameter is required but was not supplied" % e
 
-        self.manage_edit(title,
-                         connection_id,
-                         arguments,
-                         template=data)
+        # Optional parameters
+        title =           parameters.get('title','')
+        arguments =       parameters.get('arguments','')
+        max_rows =        parameters.get('max_rows',1000)
+        max_cache =       parameters.get('max_cache',100)
+        cache_time =      parameters.get('cache_time',0)
+        class_name =      parameters.get('class_name','')
+        class_file =      parameters.get('class_file','')
+        connection_hook = parameters.get('connection_hook',None)
+
+        self.manage_edit(title, connection_id, arguments, template=data)
 
         self.manage_advanced(max_rows,
                              max_cache,
                              cache_time,
-                             '', # don't really see any point in allowing
-                             '') # brain specification...
+                             class_name,
+                             class_file,
+                             connection_hook=connection_hook)
 
         # do we need to do anything on reparse?
 



More information about the CMF-checkins mailing list