Commit e00083df authored by Jean-Paul Smets's avatar Jean-Paul Smets

Extended API of getDocumentValue so that filtering is possible.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13323 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b80da4ef
...@@ -264,7 +264,7 @@ class WebSection(Domain): ...@@ -264,7 +264,7 @@ class WebSection(Domain):
# WebSection API # WebSection API
security.declareProtected(Permissions.View, 'getDocumentValue') security.declareProtected(Permissions.View, 'getDocumentValue')
def getDocumentValue(self, name=None, portal=None): def getDocumentValue(self, name=None, portal=None, **kw):
""" """
Return the default document with the given Return the default document with the given
name. The name parameter may represent anything name. The name parameter may represent anything
...@@ -275,6 +275,9 @@ class WebSection(Domain): ...@@ -275,6 +275,9 @@ class WebSection(Domain):
to returning the default document by calling to returning the default document by calling
getDefaultDocumentValue. getDefaultDocumentValue.
kw parameters can be useful to filter content
(ex. force a given validation state)
This method must be implemented through a This method must be implemented through a
portal type dependent script: portal type dependent script:
WebSection_getDocumentValue WebSection_getDocumentValue
...@@ -297,7 +300,7 @@ class WebSection(Domain): ...@@ -297,7 +300,7 @@ class WebSection(Domain):
if cache is not None: if cache is not None:
if not cache.has_key(key): cache[key] = method if not cache.has_key(key): cache[key] = method
return method(name, portal=portal) return method(name, portal=portal, **kw)
security.declareProtected(Permissions.View, 'getDefaultDocumentValue') security.declareProtected(Permissions.View, 'getDefaultDocumentValue')
def getDefaultDocumentValue(self): def getDefaultDocumentValue(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment