Changeset 114

Show
Ignore:
Timestamp:
12/26/05 04:09:22
Author:
chervol
Message:

fixed qtopic metadata listing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qTopic/branches/plone2.1/qTopic.py

    r113 r114  
    121121            allowed = DisplayList(flat) 
    122122        return allowed 
    123  
     123    """ 
    124124    security.declareProtected(ChangeTopics, "listFields") 
    125125    def listFields(self): 
    126         """Return a list of fields from portal_catalog. 
    127         """ 
    128126        pcatalog = getToolByName( self, self.getCatalog() ) 
    129127        available = pcatalog.indexes() 
     
    134132        val.sort(lambda x,y: strcoll(self.translate(x),self.translate( y))) 
    135133        return [(i, i, i)for i in val] 
     134     """ 
     135    security.declareProtected(ChangeTopics, "listFields") 
     136    def listFields(self): 
     137        """Return a list of fields from portal_catalog. 
     138        """ 
     139        tool = getToolByName(self, TOOLNAME) 
     140        return tool.getEnabledFields(catalog_name=self.geCatalog()) 
    136141 
    137142    security.declareProtected(ChangeTopics, 'listAvailableFields') 
     
    140145        """ 
    141146        return self.listFields() 
     147     
     148    security.declareProtected(View, 'listMetaDataFields') 
     149    def listMetaDataFields(self, exclude=True): 
     150        """Return a list of metadata fields from portal_catalog. 
     151        """ 
     152        tool = getToolByName(self, TOOLNAME) 
     153        return tool.getMetadataDisplay(exclude,catalog_name=self.geCatalog()) 
    142154 
    143155    security.declareProtected(CMFCorePermissions.View, "queryCatalog")