Commit cd50a7aa authored by Julien Muchembled's avatar Julien Muchembled

asPredicate() can be customized at class level by overriding _asPredicate()

parent ac3af70f
......@@ -586,22 +586,23 @@ class Predicate(XMLObject):
def asPredicate(self, script_id=None):
def asPredicate(self):
This method tries to convert the current Document into a predicate
looking up methods named Class_asPredicate, MetaType_asPredicate, PortalType_asPredicate
cache = getTransactionalVariable()
key = 'asPredicate', self, script_id
key = 'asPredicate', self
return cache[key]
except KeyError:
script = self._getTypeBasedMethod('asPredicate', script_id)
if script is not None:
self = script()
self = self._getTypeBasedMethod("asPredicate", "_asPredicate")()
cache[key] = self
return self
def _asPredicate(self):
return self
def searchPredicate(self, **kw):
Returns a list of documents matching the predicate
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment