Пример #1
0
 def show_demo(self, req, resp):
     widget = req.widget
     widget_name = widget.__class__.__name__
     interactive = self.interactive
     if have_formencode and req.method.upper() == "POST":
         # A widget submission, try to validate.
         try:
             value = widget.validate(req.POST)
             value = util.pretty_print(value)
             return self.render('validation_result.html', locals())
         except Invalid, error:
             pass
Пример #2
0
 def show_demo(self, req, resp):
     widget = req.widget
     widget_name = widget.__class__.__name__
     interactive = self.interactive
     if have_formencode and req.method.upper() == "POST":
         # A widget submission, try to validate.
         try:
             value = widget.validate(req.POST)
             value = util.pretty_print(value)
             return self.render('validation_result.html', locals())
         except Invalid, error:
             pass
Пример #3
0
    def widget_output(self, req, resp):
        try:
            key = int(req.path_info.strip('/'))
            dd = self.displayed_widgets[key]
        except KeyError:
            resp.status_int = 404
            return "There's now widget output at this URL. Maybe it has "\
                   "expired? Try increasing the 'max_dialogs' parameter"

        widget = dd.widget
        widget_name = widget.__class__.__name__
        render = self.widget_browser.render
        if have_formencode and req.method.upper() == "POST":
            # A widget submission, try to validate.
            try:
                value = widget.validate(req.POST)
                value = util.pretty_print(value)
                return render('validation_result.html', locals())
            except Invalid, error:
                pass
Пример #4
0
    def widget_output(self, req, resp):
        try:
            key = int(req.path_info.strip('/'))
            dd = self.displayed_widgets[key]
        except KeyError:
            resp.status_int = 404
            return "There's now widget output at this URL. Maybe it has "\
                   "expired? Try increasing the 'max_dialogs' parameter"

        widget = dd.widget
        widget_name = widget.__class__.__name__
        render = self.widget_browser.render
        if have_formencode and req.method.upper() == "POST":
            # A widget submission, try to validate.
            try:
                value = widget.validate(req.POST)
                value = util.pretty_print(value)
                return render('validation_result.html', locals())
            except Invalid, error:
                pass