TOMToolkit / tom_base

The base Django project for a Target and Observation Manager
https://tom-toolkit.readthedocs.io
GNU General Public License v3.0
26 stars 45 forks source link

download ReducedDatum not ingested with files #962

Closed griffin-h closed 3 months ago

griffin-h commented 3 months ago

This takes advantage of the data sharing form to provide a method of downloading photometry to a text file. Right now there's no way to download data not ingested via a file, as noted in #248. This may not be the preferred way to implement this feature request, but I'm opening a PR in case any part of the code I wrote is useful, either as an interim solution or to be reused in a better solution. Also feel free to close without merging!

To use this feature, select data from the sharing form (or select all), choose "download" as the destination, and click "submit." The "title" field will become the filename, and the "message" field will become a comment at the top of the file. The output table contains all the fields in the ReducedDatum table, not all of which are useful, including the superset of all keys in the value JSONField.