Last change
on this file since 1709 was
1695,
checked in by mylan, 14 years ago
|
#132: Reregistered ICanonicalPath adater for OFS.interfaces.ITraversable
|
-
Property svn:eol-style set to
native
|
File size:
598 bytes
|
Line | |
---|
1 | from zope.interface import implements |
---|
2 | from zope.component import adapts |
---|
3 | |
---|
4 | from OFS.interfaces import ITraversable |
---|
5 | from Products.CMFCore.utils import getToolByName |
---|
6 | |
---|
7 | from quintagroup.canonicalpath.interfaces import ICanonicalPath |
---|
8 | |
---|
9 | |
---|
10 | class canonicalPathAdapter(object): |
---|
11 | """Adapts base content to canonical path. |
---|
12 | """ |
---|
13 | adapts(ITraversable) |
---|
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.