def post(self): user = self.current_user form = NodeForm(self.request.arguments) if form.validate(): node = form.save(user) return self.redirect(node.url) return self.render("node/create.html", form=form)
def get(self): node_id = int(self.get_argument('node_id', 0)) node = Node.get(id=node_id) if node: selected = [node.name] else: selected = [] form = NodeForm.init(Node.get_node_choices(), selected) return self.render("node/create.html", form=form)
def get(self): node_id = int(self.get_argument("node_id", 0)) node = Node.get(id=node_id) if node: selected = [node.name] else: selected = [] form = NodeForm.init(Node.get_node_choices(), selected) return self.render("node/create.html", form=form)