def graph_export_tool(request, graph_slug): graph = get_object_or_404(Graph, slug=graph_slug) converter = GEXFConverter(graph) response = HttpResponse(converter.stream_export(), mimetype='application/xml') response['Content-Disposition'] = \ 'attachment; filename=%s.gexf' % graph_slug.replace("-", "_") return response
def graph_export_gexf(request, graph_slug): graph = get_object_or_404(Graph, slug=graph_slug) if graph.is_empty(): messages.error(request, _("You are trying to export data from an " "empty graph")) return redirect(reverse('dashboard')) converter = GEXFConverter(graph) response = HttpResponse(converter.stream_export(), mimetype='application/xml') attachment = 'attachment; filename=%s.gexf' % graph_slug.replace("-", "_") response['Content-Disposition'] = attachment return response
def graph_export_gexf(request, graph_slug): graph = get_object_or_404(Graph, slug=graph_slug) if graph.is_empty(): messages.error( request, _("You are trying to export data from an " "empty graph")) return redirect(reverse('dashboard')) converter = GEXFConverter(graph) response = HttpResponse(converter.stream_export(), mimetype='application/xml') attachment = 'attachment; filename=%s.gexf' % graph_slug.replace("-", "_") response['Content-Disposition'] = attachment return response