Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
e477bfaa
Commit
e477bfaa
authored
Oct 09, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache heavy method.
parent
e96ef577
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+12
-5
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
e477bfaa
...
...
@@ -37,6 +37,7 @@ from Products.ERP5Type.Globals import InitializeClass
from
Products.ERP5Type.Tool.BaseTool
import
BaseTool
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.Cache
import
DEFAULT_CACHE_SCOPE
from
Products.ERP5Type.Cache
import
CachingMethod
from
lxml
import
etree
import
time
try
:
...
...
@@ -1111,15 +1112,21 @@ class SlapTool(BaseTool):
else
:
return
l
[
0
].
getObject
()
def
_getComputerDocument
(
self
,
computer_reference
):
"""
Get the validated computer with this reference.
"""
def
_getNonCachedComputerDocument
(
self
,
computer_reference
):
return
self
.
_getDocument
(
portal_type
=
'Computer'
,
# XXX Hardcoded validation state
validation_state
=
"validated"
,
reference
=
computer_reference
)
reference
=
computer_reference
).
getRelativeUrl
()
def
_getComputerDocument
(
self
,
computer_reference
):
"""
Get the validated computer with this reference.
"""
result
=
CachingMethod
(
self
.
_getNonCachedComputerDocument
,
id
=
'_getComputerDocument'
,
cache_factory
=
'slap_cache_factory'
)(
computer_reference
)
return
self
.
getPortalObject
().
restrictedTraverse
(
result
)
@
UnrestrictedMethod
def
_getComputerUidByReference
(
self
,
computer_reference
):
...
...
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