Ignore:
Timestamp:
Mar 17, 2010 4:41:32 PM (14 years ago)
Author:
mylan
Message:

#177: Add canonical_link indexer, fix canonical_path indexer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.canonicalpath/trunk/quintagroup/canonicalpath/catalog.py

    r1685 r1928  
    44 
    55from interfaces import ICanonicalPath 
     6from interfaces import ICanonicalLink 
    67 
    78@indexer(Interface) 
     
    910    """Return canonical_path property for the object. 
    1011    """ 
    11     cpath = queryAdapter(obj, interface=ICanonicalPath) 
    12     if cpath: 
    13         return cpath.canonical_path() 
     12    adapter = queryAdapter(obj, interface=ICanonicalPath) 
     13    if adapter: 
     14        return adapter.canonical_path 
    1415    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 TracChangeset for help on using the changeset viewer.