Logo Search packages:      
Sourcecode: zope-extendedpathindex version File versions  Download package

def ExtendedPathIndex::ExtendedPathIndex::ExtendedPathIndex::__init__ (   self,
  id,
  extra = None,
  caller = None 
)
ExtendedPathIndex supports indexed_attrs 

Definition at line 49 of file ExtendedPathIndex.py.

                                                   :
        """ ExtendedPathIndex supports indexed_attrs """
        PathIndex.__init__(self, id, caller)

        def get(o, k, default):
            if isinstance(o, dict):
                return o.get(k, default)
            else:
                return getattr(o, k, default)

        attrs = get(extra, 'indexed_attrs', None)
        if attrs is None:
            return
        if isinstance(attrs, str):
            attrs = attrs.split(',')
        attrs = filter(None, [a.strip() for a in attrs])

        if attrs:
            # We only index the first attribute so snip off the rest
            self.indexed_attrs = tuple(attrs[:1])


Generated by  Doxygen 1.6.0   Back to index