Exemplo n.º 1
0
 def __init__(self, view):
     super().__init__(view)
     alert = self.add_child(Alert(view, _('An error occurred:'), 'danger'))
     alert.add_child(HTMLElement(view, 'hr'))
     alert.add_child(P(view, text=self.error_message))
     a = alert.add_child(A(view, Url(self.error_source_href), description='Ok'))
     a.use_layout(ButtonLayout(style='primary'))
Exemplo n.º 2
0
 def __init__(self, view):
     super(CustomErrorPage, self).__init__(view)
     error_widget = self.body.insert_child(0, ErrorWidget(view))
     error_widget.add_child(H(view, 1, text='My custom error page'))
     error_widget.add_child(P(view,
                              text=error_widget.error_message))
     error_widget.add_child(
         A(view,
           Url(error_widget.error_source_href),
           description='Ok'))