示例#1
0
    def _get_fields(self, fieldsets=['default']):
        with api.env.adopt_roles(['Manager']):
            edit_form = self.real_context.unrestrictedTraverse(
                '@@edit').form_instance
            edit_form.update()
            notify(EditCancelledEvent(self.real_context))

        fields = edit_form.fields.values()
        return [f.field for f in fields]
 def handleCancel(self, action):
     api.portal.show_message(_dx("Add New Item operation cancelled"),
                             self.request)
     self.request.response.redirect(self.nextURL())
     notify(EditCancelledEvent(self.context))
     parent = aq_parent(self.context)
     api.content.delete(obj=self.context)
     self.context = parent
     self.request.response.redirect(self.nextURL())
示例#3
0
 def handleCancel(self, action):
     IStatusMessage(self.request).addStatusMessage(_(u"Edit cancelled"),
                                                   "info")
     self.request.response.redirect(self.nextURL())
     notify(EditCancelledEvent(self.context))
示例#4
0
 def handleCancel(self, action):
     api.portal.show_message(_(u'Edit cancelled.'),
                             self.request,
                             type='info')
     self.request.response.redirect(self.nextURL())
     notify(EditCancelledEvent(self.context))