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
47def68c
Commit
47def68c
authored
May 07, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cache of Predicate.asPredicate
parent
347804af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
13 deletions
+10
-13
product/ERP5Type/Core/Predicate.py
product/ERP5Type/Core/Predicate.py
+10
-13
No files found.
product/ERP5Type/Core/Predicate.py
View file @
47def68c
...
...
@@ -585,21 +585,18 @@ class Predicate(XMLObject):
def
asPredicate
(
self
,
script_id
=
None
):
"""
This method tries to convert the current Document into a predicate
looking up methods named Class_asPredic
ta
e, MetaType_asPredicate, PortalType_asPredicate
looking up methods named Class_asPredic
at
e, MetaType_asPredicate, PortalType_asPredicate
"""
cache
=
getTransactionalVariable
()
key
=
id
(
self
),
script_id
if
'asPredicate'
in
cache
:
cache
=
cache
[
'asPredicate'
]
if
key
in
cache
:
return
cache
[
key
]
else
:
cache
=
cache
[
'asPredicate'
]
=
{}
script
=
self
.
_getTypeBasedMethod
(
'asPredicate'
,
script_id
)
if
script
is
not
None
:
self
=
script
()
cache
[
key
]
=
self
return
self
key
=
'asPredicate'
,
self
,
script_id
try
:
return
cache
[
key
]
except
KeyError
:
script
=
self
.
_getTypeBasedMethod
(
'asPredicate'
,
script_id
)
if
script
is
not
None
:
self
=
script
()
cache
[
key
]
=
self
return
self
def
searchPredicate
(
self
,
**
kw
):
"""
...
...
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