Пример #1
0
 def handleAdd(self):
     data, errors = self.extractData()
     if errors:
         self.flash('Es sind Fehler aufgetreten')
         return
     obj = self.createAndAdd(data)
     if obj is not None:
         # mark only as finished if we get the new object
         self._finishedAdd = True
         grok.notify(AfterSaveEvent(obj, self.request))
Пример #2
0
 def createAndAdd(self, data):
     obj = self.create(data)
     grok.notify(zope.lifecycleevent.ObjectCreatedEvent(obj))
     self.add(obj)
     return obj