Пример #1
0
 def payload(self):
     convert_request_form_to_unicode(self.request.form)
     self.update()
     form, action, status = SubFormGroupBase.updateActions(self)
     if action is None:
         form, action, status, FormCanvas.updateActions(self)
     if status is FAILURE:
         # Render correctly the validation errors
         for error in form.formErrors:
            self.send_message(error.title, type="error")
     SubFormGroupBase.updateWidgets(self)
     FormCanvas.updateWidgets(self)
     result = {'ifaces': ['form'],
               'success': status == SUCCESS,
               'forms': self.render()}
     portlets = queryMultiAdapter(
         (self.context, self.request, self), name='portlets')
     if portlets is not None:
         portlets.update()
         rendered_portlets = portlets.render().strip()
         if rendered_portlets:
             result['portlets'] = rendered_portlets
     return result
Пример #2
0
 def __init__(self, context, request):
     PageREST.__init__(self, context, request)
     SubFormGroupBase.__init__(self, context, request)
     FormCanvas.__init__(self, context, request)