Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
97ba45fb
Commit
97ba45fb
authored
Feb 29, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename version_priority ERP5Site property to version_priority_list.
parent
854bc009
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
19 deletions
+23
-19
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+10
-9
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml
...ateSourceCodeFromFilesystemDialog/my_version_priority.xml
+1
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml
...Item/portal_skins/erp5_core/Component_view/my_version.xml
+1
-1
product/ERP5/bootstrap/erp5_core/bt/change_log
product/ERP5/bootstrap/erp5_core/bt/change_log
+3
-0
product/ERP5/bootstrap/erp5_core/bt/revision
product/ERP5/bootstrap/erp5_core/bt/revision
+1
-1
product/ERP5Type/dynamic/component_package.py
product/ERP5Type/dynamic/component_package.py
+4
-4
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+3
-3
No files found.
product/ERP5/ERP5Site.py
View file @
97ba45fb
...
@@ -444,28 +444,29 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
...
@@ -444,28 +444,29 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
return
self
.
title
return
self
.
title
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getVersionPriority'
)
'getVersionPriority
List
'
)
def
getVersionPriority
(
self
):
def
getVersionPriority
List
(
self
):
# Whatever happens, a version must always be returned otherwise it may
# Whatever happens, a version must always be returned otherwise it may
# render the site unusable when all Products will have been migrated
# 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
(
'erp5'
,)
return
self
.
_version_priority
return
self
.
_version_priority
_list
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
security
.
declareProtected
(
Permissions
.
ModifyPortalContent
,
'setVersionPriority'
)
'setVersionPriority
List
'
)
def
setVersionPriority
(
self
,
value
):
def
setVersionPriority
List
(
self
,
value
):
"""
"""
XXX-arnau: must be written through an interaction workflow when ERP5Site
XXX-arnau: must be written through an interaction workflow when ERP5Site
will become a real ERP5 object...
will become a real ERP5 object...
"""
"""
self
.
_version_priority
=
value
self
.
_version_priority
_list
=
value
if
not
getattr
(
self
,
'_v_bootstrapping'
,
False
):
if
not
getattr
(
self
,
'_v_bootstrapping'
,
False
):
self
.
portal_components
.
resetOnceAtTransactionBoundary
()
self
.
portal_components
.
resetOnceAtTransactionBoundary
()
version_priority
=
property
(
getVersionPriority
,
setVersionPriority
)
version_priority_list
=
property
(
getVersionPriorityList
,
setVersionPriorityList
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getUid'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getUid'
)
def
getUid
(
self
):
def
getUid
(
self
):
...
@@ -1695,7 +1696,7 @@ class ERP5Generator(PortalGenerator):
...
@@ -1695,7 +1696,7 @@ class ERP5Generator(PortalGenerator):
# Return the fully wrapped object.
# Return the fully wrapped object.
p
=
parent
.
this
().
_getOb
(
id
)
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
erp5_sql_deferred_connection_string
=
erp5_sql_connection_string
p
.
_setProperty
(
'erp5_catalog_storage'
,
p
.
_setProperty
(
'erp5_catalog_storage'
,
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/BusinessTemplate_viewMigrateSourceCodeFromFilesystemDialog/my_version_priority.xml
View file @
97ba45fb
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<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().getVersionPriority
List
()]
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Component_view/my_version.xml
View file @
97ba45fb
...
@@ -108,7 +108,7 @@
...
@@ -108,7 +108,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: here.getPortalObject().getVersionPriority()
</string>
</value>
<value>
<string>
python: here.getPortalObject().getVersionPriority
List
()
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
product/ERP5/bootstrap/erp5_core/bt/change_log
View file @
97ba45fb
2012-02-28 arnaud.fontaine
* Rename version_priority ERP5Site property to version_priority_list.
2012-02-28 arnaud.fontaine
2012-02-28 arnaud.fontaine
* Use a ListField for version and proxify error messages field in Component view.
* Use a ListField for version and proxify error messages field in Component view.
...
...
product/ERP5/bootstrap/erp5_core/bt/revision
View file @
97ba45fb
41014
41015
\ No newline at end of file
\ No newline at end of file
product/ERP5Type/dynamic/component_package.py
View file @
97ba45fb
...
@@ -103,7 +103,7 @@ class ComponentDynamicPackage(ModuleType):
...
@@ -103,7 +103,7 @@ class ComponentDynamicPackage(ModuleType):
except
AttributeError
:
except
AttributeError
:
return
{}
return
{}
version_priority_set
=
set
(
portal
.
getVersionPriority
())
version_priority_set
=
set
(
portal
.
getVersionPriority
List
())
# contentValues should not be used for a large number of objects, but
# 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
# this is only done at startup or upon reset, moreover using the Catalog
...
@@ -155,7 +155,7 @@ class ComponentDynamicPackage(ModuleType):
...
@@ -155,7 +155,7 @@ class ComponentDynamicPackage(ModuleType):
# wrongly considered as importable and thus the actual filesystem class
# wrongly considered as importable and thus the actual filesystem class
# ignored
# ignored
elif
(
name
not
in
self
.
_registry_dict
and
elif
(
name
not
in
self
.
_registry_dict
and
name
.
replace
(
'_version'
,
''
)
not
in
site
.
getVersionPriority
()):
name
.
replace
(
'_version'
,
''
)
not
in
site
.
getVersionPriority
List
()):
return
None
return
None
return
self
return
self
...
@@ -182,7 +182,7 @@ class ComponentDynamicPackage(ModuleType):
...
@@ -182,7 +182,7 @@ class ComponentDynamicPackage(ModuleType):
component_name
=
fullname
.
replace
(
self
.
_namespace_prefix
,
''
)
component_name
=
fullname
.
replace
(
self
.
_namespace_prefix
,
''
)
if
component_name
.
endswith
(
'_version'
):
if
component_name
.
endswith
(
'_version'
):
version
=
component_name
.
replace
(
'_version'
,
''
)
version
=
component_name
.
replace
(
'_version'
,
''
)
return
(
version
in
site
.
getVersionPriority
()
and
return
(
version
in
site
.
getVersionPriority
List
()
and
self
.
_getVersionPackage
(
version
)
or
None
)
self
.
_getVersionPackage
(
version
)
or
None
)
component_id_alias
=
None
component_id_alias
=
None
...
@@ -211,7 +211,7 @@ class ComponentDynamicPackage(ModuleType):
...
@@ -211,7 +211,7 @@ class ComponentDynamicPackage(ModuleType):
return
None
return
None
for
version
in
site
.
getVersionPriority
():
for
version
in
site
.
getVersionPriority
List
():
component
=
component_version_dict
.
get
(
version
,
None
)
component
=
component_version_dict
.
get
(
version
,
None
)
if
component
is
not
None
:
if
component
is
not
None
:
break
break
...
...
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
97ba45fb
...
@@ -1589,9 +1589,9 @@ def bar(*args, **kwargs):
...
@@ -1589,9 +1589,9 @@ def bar(*args, **kwargs):
from
Products.ERP5.ERP5Site
import
getSite
from
Products.ERP5.ERP5Site
import
getSite
site
=
getSite
()
site
=
getSite
()
ComponentTool
.
reset
=
assertResetCalled
ComponentTool
.
reset
=
assertResetCalled
priority_tuple
=
site
.
getVersionPriority
()
priority_tuple
=
site
.
getVersionPriority
List
()
try
:
try
:
site
.
setVersionPriority
((
'foo'
,)
+
priority_tuple
)
site
.
setVersionPriority
List
((
'foo'
,)
+
priority_tuple
)
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
...
@@ -1607,7 +1607,7 @@ def bar(*args, **kwargs):
...
@@ -1607,7 +1607,7 @@ def bar(*args, **kwargs):
finally
:
finally
:
ComponentTool
.
reset
=
ComponentTool
.
_original_reset
ComponentTool
.
reset
=
ComponentTool
.
_original_reset
site
.
setVersionPriority
(
priority_tuple
)
site
.
setVersionPriority
List
(
priority_tuple
)
transaction
.
commit
()
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment