Kiro47 / MTU-Transfer-Course-Gatherer

I got tired of looking for classes to transfer in by hand, so here we are.
Mozilla Public License 2.0
4 stars 2 forks source link

Add model changes for real classes #71

Open Blu3spirits opened 4 years ago

Blu3spirits commented 4 years ago

This is the 'staging' commit for all the work that needs to be finished before we can implement the CourseShell model.

Notes:

Blu3spirits commented 4 years ago

Usually USD values are stored in databases as cents to avoid rounding errors; but I guess it doesn't matter as much here since we're not calculating anything off them. Up to you.

I hadn't heard that before but I see the sense in it. However looking at the data MTU stores the data with only two decimals anyway so really I don't see any issues coming about from this. I do think that eventually with the cart system a "total fees" would be useful to have. If it does become an issue ever we can switch over. Or I can increase the floating-point limits.

Blu3spirits commented 4 years ago

That being said, would using an enum or something for this field make more sense? I guess it doesn't have to be here but we should have a static list of possible tags somewhere so we can map them to values if necessary. I.e. tags with value 'Online' we may want to display with a yellow background.

I don't really think an enum would make sense since it would require a code and database change for a new tag. With this current tag model, it's very arbitrary on purpose so that we can actually do things like labels based on location. In the sync script that feeds from the scraper we just do a update_or_create() model method that creates a new label and applies to the current object. Since that bit of if location == 'online' would have to be handled it would effectively end up being static list anyway.

I think farther down the line as well after we collect data from rate my professor we could also add a tag to show that.