def update(self):
     if 'seed' in self.request:
         self.seed = self.request['seed']
         if self.seed == '':
             self.seed = None
     if 'CANCEL' in self.request:
         self.request.response.redirect(
             absoluteURL(self.context, self.request))
     if 'SUBMIT' in self.request:
         # TODO: maybe clear database here
         self.times = generate(self.context, self.seed,
                               pluginNames=self._getSelectedPlugins())
Exemple #2
0
 def update(self):
     if 'seed' in self.request:
         self.seed = self.request['seed']
         if self.seed == '':
             self.seed = None
     if 'CANCEL' in self.request:
         self.request.response.redirect(
             absoluteURL(self.context, self.request))
     if 'SUBMIT' in self.request:
         # TODO: maybe clear database here
         self.times = generate(self.context,
                               self.seed,
                               pluginNames=self._getSelectedPlugins())
 def getPlugins(self):
     selectedPlugins = self._getSelectedPlugins()
     times = generate(self.context, self.seed,
                      dry_run=True, pluginNames=selectedPlugins)
     plugins = [obj for name, obj in getUtilitiesFor(ISampleDataPlugin)]
     result = []
     if 'CLEAR' in self.request:
         return plugins
     for plugin in plugins:
         data = {'name':plugin.name}
         if plugin.name in times.keys():
             data['selected'] = True
             view = queryMultiAdapter((plugin, self.request),
                                      name="options")
             data['view'] = view
         result.append(data)
     return result
Exemple #4
0
 def getPlugins(self):
     selectedPlugins = self._getSelectedPlugins()
     times = generate(self.context,
                      self.seed,
                      dry_run=True,
                      pluginNames=selectedPlugins)
     plugins = [obj for name, obj in getUtilitiesFor(ISampleDataPlugin)]
     result = []
     if 'CLEAR' in self.request:
         return plugins
     for plugin in plugins:
         data = {'name': plugin.name}
         if plugin.name in times.keys():
             data['selected'] = True
             view = queryMultiAdapter((plugin, self.request),
                                      name="options")
             data['view'] = view
         result.append(data)
     return result