Skip to content

Commit

Permalink
Merge pull request #111 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
hot fix for json-download of network data
  • Loading branch information
csae8092 authored Nov 26, 2024
2 parents a8526c3 + a49a5c5 commit da7ec6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
8 changes: 2 additions & 6 deletions network/templates/network/list_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h1 class="display-1 text-center">
<h2>Download</h2>
<div class="btn-group" role="group" class="text-end">
<a type="button" class="btn btn-outline-primary" href="{% url 'network:data' %}{% querystring %}&format=csv">CSV</a>
<a type="button" class="btn btn-outline-primary" href="{% url 'network:data' %}{% querystring %}&format=json">JSON</a>
<a type="button" class="btn btn-outline-primary" href="{% url 'network:data' %}{% querystring %}&format=cosmograph">JSON</a>
</div>
</div>
<div class="col-md-6 text-center">
Expand Down Expand Up @@ -84,11 +84,7 @@ <h2 class="text-center">{{ total }} Result(s)</h2>
</nav>

{% endblock pagination.allpages %}
{% if download %}
<div class="float-end">
{% include "browsing/partials/download_menu.html" %}
</div>
{% endif %}

</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions network/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def network_data(request):
df["end_date"] = df["end_date"].dt.strftime("%Y-%m-%d").fillna("")
out = df.to_json(orient="index", force_ascii=False)
response = JsonResponse(json.loads(out))
return response
elif format == "cosmograph":
data = {}
edge_data = df.apply(
Expand Down

0 comments on commit da7ec6d

Please sign in to comment.