Changeset 420 in products
- Timestamp:
- Jul 25, 2006 1:51:08 PM (18 years ago)
- Location:
- qTopic/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
qTopic/trunk/Extensions/Install.py
r392 r420 41 41 path = ','.join(path) 42 42 skinstool.addSkinSelection(skinName, path) 43 44 45 43 44 pact_icons = getToolByName(self, 'portal_actionicons') 45 pact_icons.removeActionIcon('plone', 'export_csv') -
qTopic/trunk/qTopic.py
r391 r420 17 17 from Products.CMFPlone.PloneBatch import Batch 18 18 from Products.ATContentTypes.config import TOOLNAME 19 from StringIO import StringIO 20 from csv import DictWriter 21 import csv 19 22 20 23 qTopic_schema = ATTopicSchema.copy() + Schema(( … … 46 49 )) 47 50 qTopic_schema["customViewFields"].schemata = "export" 48 qTopic_schema["customViewFields"].vocabulary = " getFieldsList"51 qTopic_schema["customViewFields"].vocabulary = "listMetaDataFields" 49 52 qTopic_schema["customViewFields"].default=("id","getFullName","getEmail") 50 53 … … 78 81 return DisplayList(zip(catalogs, catalogs)) 79 82 80 def getFieldsList(self):81 """ return DisplayList of fields82 """83 pcatalog = getToolByName( self, self.getCatalog() )84 available = pcatalog.schema()85 val = [ field86 for field in available87 if field not in IGNORED_FIELDS88 ]89 val.sort(lambda x,y: strcoll(self.translate(x),self.translate( y)))90 return [(i, i, i)for i in val]91 92 83 security.declareProtected(ChangeTopics, "criteriaByIndexId") 93 84 def criteriaByIndexId(self, indexId): 94 """ get createrias b uindex """85 """ get createrias by index """ 95 86 catalog_tool = getToolByName(self, self.getCatalog()) 96 87 indexObj = catalog_tool.Indexes[indexId] … … 114 105 allowed = DisplayList(flat) 115 106 return allowed 116 """ 117 security.declareProtected(ChangeTopics, "listFields") 118 def listFields(self): 119 pcatalog = getToolByName( self, self.getCatalog() ) 120 available = pcatalog.indexes() 121 val = [ field 122 for field in available 123 if field not in IGNORED_FIELDS 124 ] 125 val.sort(lambda x,y: strcoll(self.translate(x),self.translate( y))) 126 return [(i, i, i)for i in val] 127 """ 107 128 108 security.declareProtected(ChangeTopics, "listFields") 129 109 def listFields(self): … … 202 182 return results 203 183 184 def toCSV(self, fields, data): 185 dialect = csv.excel() 186 dialect.delimiter = self.getDelimiter() 187 buffer = StringIO() 188 writer = DictWriter(buffer, fieldnames=fields, dialect=dialect) 189 if self.getShowHeader(): 190 writer.writerow(dict(zip(fields, fields))) 191 writer.writerows(data) 192 return buffer.getvalue() 204 193 205 194 … … 210 199 """ 211 200 actions = [] 201 fti['allowed_content_types'] = ('qTopic',) 202 fti['filter_content_types'] = 1 212 203 for action in fti["actions"]: 213 204 if action["id"] == "folderlisting":
Note: See TracChangeset
for help on using the changeset viewer.