def handleApply(self, action): data, errors = self.extractData() if errors: self.status = self.formErrorsMessage return content = self.getContent() edit(content, data) IStatusMessage(self.request).addStatusMessage(___(u"Changes saved"), "info") self.request.response.redirect(self.nextURL()) notify(EditFinishedEvent(self.context))
def handleAdd(self, action): data, errors = self.extractData() if errors: self.status = self.formErrorsMessage return obj = self.create() self.add(obj, data) if obj is not None: # mark only as finished if we get the new object self._finishedAdd = True IStatusMessage(self.request).addStatusMessage(___(u"Item created"), "info") self.request.response.redirect(self.nextURL())
def handleCancel(self, action): IStatusMessage(self.request).addStatusMessage(___(u"Add New Item operation cancelled"), "info") self.request.response.redirect(self.nextURL()) notify(AddCancelledEvent(self.context))
def handleCancel(self, action): IStatusMessage(self.request).addStatusMessage(___(u"Edit cancelled"), "info") self.request.response.redirect(self.nextURL()) notify(EditCancelledEvent(self.context))