[Erp5-report] r10925 - /erp5/trunk/products/ERP5/ERP5Site.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Oct 25 02:03:25 CEST 2006


Author: alex
Date: Wed Oct 25 02:03:22 2006
New Revision: 10925

URL: http://svn.erp5.org?rev=10925&view=rev
Log:
Do not use CatalogTool.addDefaultSQLMethods anymore to bootstrap the creation
of the SQLCatalog when creating a new site. Instead, we just import the
SQLMethods and properties defined in erp5_core.

This removes the need to maintain the catalog in ERP5Catalog/sql AND the
erp5_core business template (which is now used exclusively, for both
installation and upgrade of catalog methods).

Modified:
    erp5/trunk/products/ERP5/ERP5Site.py

Modified: erp5/trunk/products/ERP5/ERP5Site.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/ERP5Site.py?rev=10925&r1=10924&r2=10925&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/ERP5Site.py (original)
+++ erp5/trunk/products/ERP5/ERP5Site.py Wed Oct 25 02:03:22 2006
@@ -923,8 +923,8 @@
                    cmf_activity_sql_connection_string, 'string')
     # XXX hardcoded charset
     p._setProperty('management_page_charset', 'UTF-8', 'string')
-    self.setup(p, create_userfolder,
-               create_activities=create_activities, **kw)
+    self.setup(p, create_userfolder, create_activities=create_activities,
+        reindex=reindex, **kw)
     return p
 
   def setupLastTools(self, p, **kw):
@@ -1073,18 +1073,11 @@
 
     portal_catalog = getToolByName(p, 'portal_catalog')
     if (not update) and (not portal_catalog.getSQLCatalog('erp5_mysql')):
-      # Add a default SQL Catalog
-      portal_catalog.addDefaultSQLMethods()
-      if (p.erp5_sql_connection_type is not None):
-        portal_catalog.manage_catalogClear()
-      # TODO: Replace previous lines with the commented below
-      # (not working actually).
-      # The goal is to delete addDefaultSQLMethods() method and duplicated zsql
-      # method from /ERP5Catalog/sql/mysql_erp5.
-      #addSQLCatalog = portal_catalog.manage_addProduct['ZSQLCatalog']\
-      #                                .manage_addSQLCatalog
-      #addSQLCatalog('erp5_mysql', '')
-      #portal_catalog.default_sql_catalog_id = 'erp5_mysql'
+      # Add a empty SQL Catalog, which will be filled when installing
+      # erp5_core business template
+      portal_catalog.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(
+          'erp5_mysql', '')
+      portal_catalog.default_sql_catalog_id = 'erp5_mysql'
 
     # Add ERP5Form Tools
     addTool = p.manage_addProduct['ERP5Form'].manage_addTool
@@ -1192,7 +1185,7 @@
 
   def setupIndex(self, p, **kw):
     # Make sure all tools and folders have been indexed
-    if kw.has_key('reindex') and kw['reindex']==0:
+    if not kw.get('reindex', 1):
       return
     skins_tool = getToolByName(p, 'portal_skins', None)
     if skins_tool is None:




More information about the Erp5-report mailing list