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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
cd50a7aa
Commit
cd50a7aa
authored
Aug 11, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asPredicate() can be customized at class level by overriding _asPredicate()
parent
ac3af70f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
product/ERP5Type/Core/Predicate.py
product/ERP5Type/Core/Predicate.py
+6
-5
No files found.
product/ERP5Type/Core/Predicate.py
View file @
cd50a7aa
...
@@ -586,22 +586,23 @@ class Predicate(XMLObject):
...
@@ -586,22 +586,23 @@ class Predicate(XMLObject):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'asPredicate'
)
'asPredicate'
)
def
asPredicate
(
self
,
script_id
=
None
):
def
asPredicate
(
self
):
"""
"""
This method tries to convert the current Document into a predicate
This method tries to convert the current Document into a predicate
looking up methods named Class_asPredicate, MetaType_asPredicate, PortalType_asPredicate
looking up methods named Class_asPredicate, MetaType_asPredicate, PortalType_asPredicate
"""
"""
cache
=
getTransactionalVariable
()
cache
=
getTransactionalVariable
()
key
=
'asPredicate'
,
self
,
script_id
key
=
'asPredicate'
,
self
try
:
try
:
return
cache
[
key
]
return
cache
[
key
]
except
KeyError
:
except
KeyError
:
script
=
self
.
_getTypeBasedMethod
(
'asPredicate'
,
script_id
)
self
=
self
.
_getTypeBasedMethod
(
"asPredicate"
,
"_asPredicate"
)()
if
script
is
not
None
:
self
=
script
()
cache
[
key
]
=
self
cache
[
key
]
=
self
return
self
return
self
def
_asPredicate
(
self
):
return
self
def
searchPredicate
(
self
,
**
kw
):
def
searchPredicate
(
self
,
**
kw
):
"""
"""
Returns a list of documents matching the predicate
Returns a list of documents matching the predicate
...
...
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