diff --git a/product/ERP5/ERP5Site.py b/product/ERP5/ERP5Site.py index 71f8decce98ad2d9788b68211d6193d7762edd1e..690f05c6ac74d595f510d379435920d1935dd1a3 100644 --- a/product/ERP5/ERP5Site.py +++ b/product/ERP5/ERP5Site.py @@ -444,28 +444,29 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin): return self.title security.declareProtected(Permissions.AccessContentsInformation, - 'getVersionPriority') - def getVersionPriority(self): + 'getVersionPriorityList') + def getVersionPriorityList(self): # Whatever happens, a version must always be returned otherwise it may # render the site unusable when all Products will have been migrated - if not self._version_priority: + if not self._version_priority_list: return ('erp5',) - return self._version_priority + return self._version_priority_list security.declareProtected(Permissions.ModifyPortalContent, - 'setVersionPriority' ) - def setVersionPriority(self, value): + 'setVersionPriorityList' ) + def setVersionPriorityList(self, value): """ XXX-arnau: must be written through an interaction workflow when ERP5Site will become a real ERP5 object... """ - self._version_priority = value + self._version_priority_list = value if not getattr(self, '_v_bootstrapping', False): self.portal_components.resetOnceAtTransactionBoundary() - version_priority = property(getVersionPriority, setVersionPriority) + version_priority_list = property(getVersionPriorityList, + setVersionPriorityList) security.declareProtected(Permissions.AccessContentsInformation, 'getUid') def getUid(self): @@ -1695,7 +1696,7 @@ class ERP5Generator(PortalGenerator): # Return the fully wrapped object. p = parent.this()._getOb(id) - p._setProperty('version_priority', ('erp5',), 'lines') + p._setProperty('version_priority_list', ('erp5',), 'lines') erp5_sql_deferred_connection_string = erp5_sql_connection_string p._setProperty('erp5_catalog_storage', diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml index ae48dfd62e594f09ce6798f14154de82524c78f8..bd53508ea9251fa4d35e533cd52915b842dc2859 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml @@ -123,7 +123,7 @@ <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python: [(v, v) for v in here.getPortalObject().getVersionPriority()]</string> </value> + <value> <string>python: [(v, v) for v in here.getPortalObject().getVersionPriorityList()]</string> </value> </item> </dictionary> </pickle> diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml index 664c04bb8e1e7facf8dde68bea6cc75e939dae7d..f66015f4567831adc448aaea1d95f867312fe897 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml @@ -108,7 +108,7 @@ <dictionary> <item> <key> <string>_text</string> </key> - <value> <string>python: here.getPortalObject().getVersionPriority()</string> </value> + <value> <string>python: here.getPortalObject().getVersionPriorityList()</string> </value> </item> </dictionary> </pickle> diff --git a/product/ERP5/bootstrap/erp5_core/bt/change_log b/product/ERP5/bootstrap/erp5_core/bt/change_log index edb9e6ddb699b87447b3b38efd3e7933ae9b0c8e..4845bfd9465fcc6b48d9faab3a8b9a77e1088708 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/change_log +++ b/product/ERP5/bootstrap/erp5_core/bt/change_log @@ -1,3 +1,6 @@ +2012-02-28 arnaud.fontaine +* Rename version_priority ERP5Site property to version_priority_list. + 2012-02-28 arnaud.fontaine * Use a ListField for version and proxify error messages field in Component view. diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 841db385a965244da2f8e16bdf80f804b52318bd..6200434381f83988653c9aad0eb5ee3b5a9cc73d 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -41014 \ No newline at end of file +41015 \ No newline at end of file diff --git a/product/ERP5Type/dynamic/component_package.py b/product/ERP5Type/dynamic/component_package.py index 49f7307203aa79f0247c3470fa907cf110e7537f..ddee651e2955d3d02163cedef452e95a854732d6 100644 --- a/product/ERP5Type/dynamic/component_package.py +++ b/product/ERP5Type/dynamic/component_package.py @@ -103,7 +103,7 @@ class ComponentDynamicPackage(ModuleType): except AttributeError: return {} - version_priority_set = set(portal.getVersionPriority()) + version_priority_set = set(portal.getVersionPriorityList()) # contentValues should not be used for a large number of objects, but # this is only done at startup or upon reset, moreover using the Catalog @@ -155,7 +155,7 @@ class ComponentDynamicPackage(ModuleType): # wrongly considered as importable and thus the actual filesystem class # ignored elif (name not in self._registry_dict and - name.replace('_version', '') not in site.getVersionPriority()): + name.replace('_version', '') not in site.getVersionPriorityList()): return None return self @@ -182,7 +182,7 @@ class ComponentDynamicPackage(ModuleType): component_name = fullname.replace(self._namespace_prefix, '') if component_name.endswith('_version'): version = component_name.replace('_version', '') - return (version in site.getVersionPriority() and + return (version in site.getVersionPriorityList() and self._getVersionPackage(version) or None) component_id_alias = None @@ -211,7 +211,7 @@ class ComponentDynamicPackage(ModuleType): return None - for version in site.getVersionPriority(): + for version in site.getVersionPriorityList(): component = component_version_dict.get(version, None) if component is not None: break diff --git a/product/ERP5Type/tests/testDynamicClassGeneration.py b/product/ERP5Type/tests/testDynamicClassGeneration.py index 93fc642ac10eb0cf8e0a11c5b7d56de222b1afa7..07bf42ab675db1fadc546e22ee362277f4d4e99d 100644 --- a/product/ERP5Type/tests/testDynamicClassGeneration.py +++ b/product/ERP5Type/tests/testDynamicClassGeneration.py @@ -1589,9 +1589,9 @@ def bar(*args, **kwargs): from Products.ERP5.ERP5Site import getSite site = getSite() ComponentTool.reset = assertResetCalled - priority_tuple = site.getVersionPriority() + priority_tuple = site.getVersionPriorityList() try: - site.setVersionPriority(('foo',) + priority_tuple) + site.setVersionPriorityList(('foo',) + priority_tuple) transaction.commit() self.tic() @@ -1607,7 +1607,7 @@ def bar(*args, **kwargs): finally: ComponentTool.reset = ComponentTool._original_reset - site.setVersionPriority(priority_tuple) + site.setVersionPriorityList(priority_tuple) transaction.commit() self.tic()