Swarthmore / litterfall

Application and Scripts used for the Litterfall Project
0 stars 1 forks source link

Redo the CSV export function #41

Closed zafire06 closed 11 years ago

zafire06 commented 11 years ago

Since we've been changing the date format too often, now the CSV export button is very buggy—as well as the exported CSV file itself.

Sorry, @jadams1 this is totally not my fault.

zafire06 commented 11 years ago

I experimented with the Python script, so that a Python script file could generate a CSV file—but by reconnecting to MongoDB and putting the weight on the server's side to generate the CSV file. This might make sense if we want to include the CSV download buttons in the first page, but reconnecting the database does not make sense if we are currently on the analysis or the update page, since it puts the load on the server's side unnecessarily.

zafire06 commented 11 years ago

Right now the export function on the Javascript is fixed formatting-wise. The current problem lies in how we can have sufficient control over the header of the newly generated file. Javascript seems unable to do the job, but we still want it to do most of the CSV file generation. What I would do with this issue instead would be to POST the CSV data to a Python file which will generate the correct header for the file. This way, though the server has to carry a weight, it is going to be lighter than having it to generate the whole thing by connecting to the database again.