When a user clicks on save, the following chain of events needs to take place:
- A file called abq_data_record_CURRENTDATE.csv is opened
- If the file doesn't exist, it will be created, and field headers will be written to the first line
- The data dictionary is retrieved from DataEntryForm
- The data is formatted as a CSV row and appended to the file
- The form is cleared, and the user is notified that the record was saved
We're going to need a few more Python libraries to help us out with this:
- First, we'll need a date string for our filename. Python's datetime library can help us here.
- Next, we'll need to be able to check if a file exists. Python's os library has a function for this.
- Finally, we need to be able to write to a CSV ...