Commit 86804491 authored by Ivan Tyagov's avatar Ivan Tyagov

Root ERP5 site lacks getRelativeUrl. Add it for consistency so we do not have...

Root ERP5 site lacks getRelativeUrl. Add it for consistency so we do not have to add ugly code exceptions in scripts.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38414 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8eff622e
...@@ -340,6 +340,13 @@ class ERP5Site(FolderMixIn, CMFSite): ...@@ -340,6 +340,13 @@ class ERP5Site(FolderMixIn, CMFSite):
""" """
return join(self.getPhysicalPath(),'/') return join(self.getPhysicalPath(),'/')
security.declareProtected(Permissions.AccessContentsInformation, 'getRelativeUrl')
def getRelativeUrl(self):
"""
Returns the url of an object relative to the portal site.
"""
return self.getPortalObject().portal_url.getRelativeUrl(self)
# Old name - for compatibility # Old name - for compatibility
security.declareProtected(Permissions.AccessContentsInformation, 'getPath') security.declareProtected(Permissions.AccessContentsInformation, 'getPath')
getPath = getUrl getPath = getUrl
......
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