source: products/quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/catalog.py @ 1929

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 
1from zope.interface import Interface
2from zope.component import queryAdapter
3from plone.indexer.decorator import indexer
4
5from interfaces import ICanonicalPath
6from interfaces import ICanonicalLink
7
8@indexer(Interface)
9def 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)
18def 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.