Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional fields to published projects CSV download #2280

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion physionet-django/console/templates/console/downloads.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h6>Users</h6>
<h6>Published projects</h6>
<p>Download a complete list of published projects, including project names, descriptions, and timelines.</p>
<a href="{% url 'download_projects' %}" class="btn btn-primary">
Download projects
Download published projects
</a>
</div>

Expand Down
8 changes: 8 additions & 0 deletions physionet-django/console/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,8 @@ def download_projects(request):
writer.writerow(["project_id",
"core_project_id",
"project_slug",
"resource_type_id",
"resource_type",
"version",
"publish_date",
"has_other_versions",
Expand All @@ -2485,6 +2487,8 @@ def download_projects(request):
"access_policy",
"license",
"data_use_agreement",
"signed_dua_count",
"storage_size_mb",
"project_home_page",
"ethics_statement",
"corresponding_author_id",
Expand All @@ -2508,6 +2512,8 @@ def clean_html(html_content):
project_data = [project.id,
project.core_project.id,
project.slug,
project.resource_type_id,
project.resource_type.name,
project.version,
project.publish_datetime,
project.has_other_versions,
Expand All @@ -2531,6 +2537,8 @@ def clean_html(html_content):
project.access_policy,
project.license,
project.dua,
DUASignature.objects.filter(project=project.id).count(),
round(project.main_storage_size / 1000000, 1),
project.project_home_page,
clean_html(project.ethics_statement),
', '.join(str(author.id) for author in authors if author.is_corresponding),
Expand Down
Loading