store data with multiple rows

dear all, im looking to store stock prices pulled from yahoo via library yfinance.

I am new to it. I did make it to the json view BUT i am stuck there.

The courses I attended so far shows a lot of database examples where they key in the data 1 in each category. However for my case, pulling the data from yfinance results in a column of dates and a few columns of financial data.

Seek advice from experts here to show me the way on how to store them in a database.

Thank you!

For example: after connecting urls.py to views.py, I can input the python code to pull data using yfinance on view.py, but idk how i can store in models.

The same way you store any other data in models. You create instances of those models and then call the save method on those instances. Or, you can use the bulk_create method to add a list of models in one call.

You might want to review the docs at:

1 Like

Thank you for the quick answer. I shall look through again! Cheers.