Data Tables
All data used in this project is stored in tables. This is pretty common! Don’t be worried.
Django Tables (Models)
Models are how django codes tables. Check out models.py in the mld app for examples. To get a table in models.py into django run the following commands.
# Make sure you're in the directory manage.py is in.
$ python manage.py makemigrations
$ python manage.py migrate
Static Products
All static products are going to be structure into tables.
Ingesting CSV Data
To ingest CSV data, the right way to do it involves using migrations.py. We aren’t doing that b/c I couldn’t figure it out. Instead we’re using management commands. Checkout mld->management->commands->ingest_data.py, you can write in your own code to ingest a csv file from the raw data directory under commands. You run the ingest by the following:
# Make sure you're in the directory manage.py is in.
$ python manage.py ingest_data [TABLENAME] [TABLENAME]
If you end up writing a new table ingest in the python file, don’t forget to add a delete all command so you’re not just adding continously.