Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)