def edit_node(node): g = Graph() if request.method == 'POST': _edit_node(g, node) return render_template( 'main/edit.html', graph=g, nodes=g.nodes, node=node, paths=g.get_paths_from(node) )
def add_node(): g = Graph() node = "" error = "" if request.method == "POST": new_node = request.form.get("current_node") nodes = request.form.getlist("node") weights = request.form.getlist("weight") if _add_node(g): return redirect(url_for("main.index")) error = "Can't create node {}. It already exists.".format(new_node) return render_template( "main/edit.html", graph=g, nodes=g.nodes, node=node, paths=g.get_paths_from(node), error=error )
def index(): g = Graph() return render_template( 'network_table/index.html', graph=g, nodes=g.nodes, )
def index(): from networkx.readwrite import json_graph g = Graph() return render_template( 'main/index.html', graph=g, nodes=g.nodes )
def add_node(): g = Graph() node = '' error = '' if request.method == 'POST': new_node = request.form.get('current_node') nodes = request.form.getlist('node') weights = request.form.getlist('weight') if _add_node(g): return redirect(url_for('main.index')) error = "Can't create node {}. It already exists.".format(new_node) return render_template( 'main/edit.html', graph=g, nodes=g.nodes, node=node, paths=g.get_paths_from(node), error=error )
def edit_node(node): g = Graph() if request.method == "POST": _edit_node(g, node) return render_template("main/edit.html", graph=g, nodes=g.nodes, node=node, paths=g.get_paths_from(node))
def delete_node(node): _delete_node(Graph(), node) return redirect(url_for('main.index'))