jchiare / sechallenge

Import CSV file
1 stars 0 forks source link

Sum Monthly total on-demand #5

Open Incognito opened 7 years ago

Incognito commented 7 years ago

In general it is a good practice to isolate concerns of your code. Here are some great articles on that:

https://drive.google.com/file/d/0ByOwmqah_nuGNHEtcU5OekdDMkk/view https://en.wikipedia.org/wiki/Separation_of_concerns

The way the CSV import is done can be split into two concerns:

https://github.com/jaychiarella/sechallenge/blob/master/expensesite/models.py#L7 https://github.com/jaychiarella/sechallenge/blob/master/expensesite/CSV_import.py#L25

See if you can find a way to just save exactly the CSV without doing both the parsing, saving to database, and making a sum total for the report.

This would require that you also must compute the value of the month on the page load of the report.

(There will be additional challenges in this topic, this is the first step).