Last change
on this file since 1929 was
1928,
checked in by mylan, 14 years ago
|
#177: Add canonical_link indexer, fix canonical_path indexer
|
-
Property svn:eol-style set to
native
|
File size:
690 bytes
|
Line | |
---|
1 | from zope.interface import Interface |
---|
2 | from zope.component import queryAdapter |
---|
3 | from plone.indexer.decorator import indexer |
---|
4 | |
---|
5 | from interfaces import ICanonicalPath |
---|
6 | from interfaces import ICanonicalLink |
---|
7 | |
---|
8 | @indexer(Interface) |
---|
9 | def canonical_path(obj, **kwargs): |
---|
10 | """Return canonical_path property for the object. |
---|
11 | """ |
---|
12 | adapter = queryAdapter(obj, interface=ICanonicalPath) |
---|
13 | if adapter: |
---|
14 | return adapter.canonical_path |
---|
15 | return None |
---|
16 | |
---|
17 | @indexer(Interface) |
---|
18 | def canonical_link(obj, **kwargs): |
---|
19 | """Return canonical_link property for the object. |
---|
20 | """ |
---|
21 | adapter = queryAdapter(obj, interface=ICanonicalLink) |
---|
22 | if adapter: |
---|
23 | return adapter.canonical_link |
---|
24 | return None |
---|
Note: See
TracBrowser
for help on using the repository browser.