#6845 (The CsvExportable model mixin)

by Luc Saffre · in Developers · assigned to Luc Saffre

Kurzbeschreibung

Needed by customer request #6842 (Noten 1. und 2. Periode 5. und 6. Schuljahr).

While the expert_excel plugin makes all tables exportable to Excel, this new feature creates one csv file per row. The model is expected to define method get_csv_rows(). This also adds a new icon_name "download".

Kinder

Kommentare

  • 4 Monate, 3 Wochen ago von Luc Saffre Antwort auf Luc Saffre about #6845 (The CsvExportable model mixin) : But I'm not sure. When looking at the ar2workbook() function, we can see that it handles a number of types. Not sure how these cases would behave when exporting to simple csv files. Especially for negative durations I'd like some test coverage before doing anything.
  • 4 Monate, 3 Wochen ago von Luc Saffre about #6845 (The CsvExportable model mixin) (1 Antwort) : We are currently using the openpyxl package to generate .xlsx files from every tables. I wonder whether we should simply write csv files instead.
  • 4 Monate, 3 Wochen ago von Luc Saffre about #6845 (The CsvExportable model mixin) : I upgraded the pdg production site for testing this. The csv file produced by CsvExportable now uses the locale for rendering numbers. And on Windows it says delimiter=";". The file now opens correctly on my client (Ubuntu) and I hope that it will also open correctly for their Windows clients.
  • 4 Monate, 3 Wochen ago von Luc Saffre about #6845 (The CsvExportable model mixin) : They downloaded the files and Lino logged: "20260602 Detected user agent OS family is Windows", so the ua-parser module seems to work well. But it seems that the OS isn't enough, it also depends on the client's locale settings. The biggest problem is that Excel doesn't ask for these options when you...
  • 4 Monate, 3 Wochen ago von Luc Saffre about #6845 (The CsvExportable model mixin) : The new feature works for this particular use case, so I mark it as ready. Though I guess that it will still evolve.
  • 4 Monate, 3 Wochen ago von Luc Saffre about #6845 (The CsvExportable model mixin) : Created new Ticket #6845 (The CsvExportable model mixin).