Commit 97ba45fb authored by Arnaud Fontaine's avatar Arnaud Fontaine

Rename version_priority ERP5Site property to version_priority_list.

parent 854bc009
......@@ -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',
......
......@@ -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>
......
......@@ -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>
......
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.
......
41014
\ No newline at end of file
41015
\ No newline at end of file
......@@ -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
......
......@@ -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()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment