def _new(self): results = self.form_result['product_category'] c.product_category = ProductCategory(**results) meta.Session.add(c.product_category) meta.Session.commit() h.flash("Category created") redirect_to(action='view', id=c.product_category.id)