source: products/quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/adapters.py @ 782

Last change on this file since 782 was 782, checked in by crchemist, 17 years ago

Added translation for portal_status_message.

  • Property svn:eol-style set to native
File size: 588 bytes
Line 
1from zope.interface import implements
2from zope.component import adapts
3
4from Products.CMFCore.utils import getToolByName
5from Products.Archetypes.interfaces import IBaseContent
6
7from interfaces import ICanonicalPath
8
9
10class canonicalPathAdapter(object):
11    """Adapts base content to canonical path.
12    """
13    adapts(IBaseContent)
14    implements(ICanonicalPath)
15
16    def __init__(self, context):
17        self.context = context
18
19    def canonical_path(self):
20        purl = getToolByName(self.context,'portal_url')
21        return '/'+'/'.join(purl.getRelativeContentPath(self.context))
Note: See TracBrowser for help on using the repository browser.