Ejemplo n.º 1
0
    def post(self, *args, **kwargs):
        form = template_forms.tpl_add_form()
        if not form.validates(source=self.get_params()):
            return self.render("base_form.html", form=form)

        tpl = models.TraTemplate()
        tpl.tpl_name = form.d.tpl_name
        tpl.tpl_desc = form.d.tpl_desc
        self.db.add(tpl)

        self.db.commit()
        self.redirect("/template")
Ejemplo n.º 2
0
 def get(self):
     form = template_forms.tpl_add_form()
     self.render("base_form.html", form=form)