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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
db4b73b1
Commit
db4b73b1
authored
Mar 08, 2012
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache the results of getVersionPriorityNameList as it's called very often when loading Components.
parent
77cd4c4a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
product/ERP5/ERP5Site.py
product/ERP5/ERP5Site.py
+15
-3
No files found.
product/ERP5/ERP5Site.py
View file @
db4b73b1
...
...
@@ -465,6 +465,12 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
self
.
_version_priority_list
=
value
# Reset cached value of getVersionPriorityNameList() if present
try
:
del
self
.
_v_version_priority_name_list
except
AttributeError
:
pass
if
not
getattr
(
self
,
'_v_bootstrapping'
,
False
):
self
.
portal_components
.
resetOnceAtTransactionBoundary
()
...
...
@@ -474,9 +480,15 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getVersionPriorityNameList'
)
def
getVersionPriorityNameList
(
self
):
# XXX-arnau: should be cached?
return
[
name
.
split
(
'|'
)[
0
].
strip
()
for
name
in
self
.
getVersionPriorityList
()]
"""
Get only the version names ordered by priority and cache it as it is used
very often in Component import hooks
"""
if
getattr
(
self
,
'_v_version_priority_name_list'
,
None
)
is
None
:
self
.
_v_version_priority_name_list
=
\
[
name
.
split
(
'|'
)[
0
].
strip
()
for
name
in
self
.
getVersionPriorityList
()]
return
self
.
_v_version_priority_name_list
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getUid'
)
def
getUid
(
self
):
...
...
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