Download a single factsheet from its detail page

Abierto
#2,628 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
70/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
django, python
Área
full-stack

Línea de trabajo

Start in modelview/urls.py with the existing download route and modelview/views.py (model_to_csv_view, printable), then the detail-page templates for models/frameworks where a toolbar action would sit beside Edit. Reuse the list export's CSV header for a one-row response, and read modelview/tests/test_read_path.py for the pinned tags column characterisation test before touching shared column code. Done looks like: a public <sheettype>/<pk>/download/ route serving one factsheet, plus a Download button on the detail page.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Factsheets type: enhancement :gear:

What

Let a reader download one model or framework factsheet from its detail page (/factsheets/models/<id>/, /factsheets/frameworks/<id>/).

Why

  • Today the only export is the list page's "Download CSV" (modelview:download → model_to_csv_view). It exports all factsheets of a type, or the tag-filtered set.
  • The detail page has never offered a download. Its templates' history back to 2016 has none.
  • A reader who wants one factsheet has to download the whole set and find the row.
  • The request is old: #886 asked for it (single factsheet, e.g. as PDF or JSON) and was closed in February 2025 without being built. #218 asked for it in 2017.

Where it would go

The stage-2 design work (homepage wayfinder map, WF-11 prototype) gives the detail page a toolbar: tags at the start, the record's actions at the end (Delete, Edit). A "Download" action belongs there, beside Edit.

Open questions for the effort

  • Format(s):
    • CSV, one row with the same columns as the list export, reusing model_to_csv_view's header;
    • JSON;
    • a formatted PDF, as #886 asked.
  • Route: e.g. <sheettype>s/<pk>/download/?format=…, beside the existing list download.
  • Access: public, like the detail page and the list export.

Related defect, worth fixing in the same effort

The existing CSV's tags column is the constant dataedit.Tag.None in every row:

  • the header code emits the many-to-many field, because it has an attname;
  • the row code writes the related manager's __str__.

It is pinned as a characterisation test in modelview/tests/test_read_path.py. A single-factsheet export that reuses those columns would inherit the defect.

Pointers

  • modelview/urls.py: the download route
  • modelview/views.py: model_to_csv_view, printable
  • modelview/templates/modelview/modellist.html: the existing "Download CSV" button

Not part of the homepage/design map. To be picked up as its own effort.

Lenguaje dominante
Python
Estrellas
65
Forks
28
Merge medio
4 d 7 h
PR fusionados (30 d)
25

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de OpenEnergyPlatform/oeplatform

Todos los issues de OpenEnergyPlatform/oeplatform

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.