Changeset 4181 for waeup/branches
- Timestamp:
- 27 May 2009, 08:48:19 (15 years ago)
- Location:
- waeup/branches/ulif-rewrite/src/waeup
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/datacenter.py
r4177 r4181 13 13 from zope.interface import Interface 14 14 from waeup.interfaces import IWAeUPObject, IWAeUPCSVImporter, ICSVDataReceivers 15 from waeup.viewlets import Index, ImportCSV, MainArea, LeftSidebar 15 from waeup.viewlets import Index, MainArea, LeftSidebar 16 #from waeup.viewlets import ImportCSV 16 17 17 18 class DataCenter(grok.Container): … … 252 253 return u'<div class="portlet"><a href="@@settings">Settings</a></div>' 253 254 255 class ImportCSV(grok.View): 256 """A view for importing things. 257 258 """ 259 grok.require('waeup.manageUniversity') 260 grok.template('master') 261 262 def update(self, csvfile=None, clear=None, overwrite=None, 263 receiverid=None, CANCEL=None, SUBMIT=None): 264 if CANCEL is not None: 265 self.redirect(self.url(self.context)) 266 return 267 if not csvfile: 268 return 269 if not SUBMIT: 270 return 271 receivers = self.context.getReceiverIds() 272 if receiverid not in receivers.keys(): 273 return 274 receiver = receivers[receiverid] 275 from waeup.interfaces import IWAeUPCSVImporter 276 importer = IWAeUPCSVImporter(receiver) 277 importer.doImport(csvfile) 278 return 279 254 280 class Import(object): 255 281 def __init__(self, filedescr, importers): -
waeup/branches/ulif-rewrite/src/waeup/viewlets.py
r4178 r4181 69 69 return 70 70 71 class ImportCSV(grok.View):72 """A view for importing things.73 74 """75 grok.require('waeup.manageUniversity')76 grok.template('master')77 78 def update(self, csvfile=None, clear=None, overwrite=None,79 receiverid=None, CANCEL=None, SUBMIT=None):80 if CANCEL is not None:81 self.redirect(self.url(self.context))82 return83 if not csvfile:84 return85 if not SUBMIT:86 return87 receivers = self.context.getReceiverIds()88 if receiverid not in receivers.keys():89 return90 receiver = receivers[receiverid]91 from waeup.interfaces import IWAeUPCSVImporter92 importer = IWAeUPCSVImporter(receiver)93 importer.doImport(csvfile)94 return95 96 71 class Head(grok.ViewletManager): 97 72 """additions to HTML head"""
Note: See TracChangeset for help on using the changeset viewer.