# store data with multiple rows

**URL:** <https://forum.djangoproject.com/t/store-data-with-multiple-rows/16835>\
**Category:** Using the ORM\
**Created:** [November 5, 2022, 10:22am UTC](https://forum.djangoproject.com/t/store-data-with-multiple-rows/16835 "2022-11-05T10:22:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BethelMH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bethelmh/32/10590_2.png) [@BethelMH](https://forum.djangoproject.com/u/BethelMH)\
**Post date:** [November 5, 2022, 10:22am UTC](https://forum.djangoproject.com/t/store-data-with-multiple-rows/16835/1 "2022-11-05T10:22:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 5, 2022, 12:08pm UTC](https://forum.djangoproject.com/t/store-data-with-multiple-rows/16835/2 "2022-11-05T12:08:54Z")

</div>

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:

- [https://docs.djangoproject.com/en/4.1/topics/db/models/](https://docs.djangoproject.com/en/4.1/topics/db/models/)
- [QuerySet API reference | Django documentation | Django](https://docs.djangoproject.com/en/4.1/ref/models/querysets/)
- [https://docs.djangoproject.com/en/4.1/ref/models/instances/](https://docs.djangoproject.com/en/4.1/ref/models/instances/)

---

<div class="post-metadata">

**Author:** ![BethelMH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/bethelmh/32/10590_2.png) [@BethelMH](https://forum.djangoproject.com/u/BethelMH)\
**Post date:** [November 5, 2022, 12:16pm UTC](https://forum.djangoproject.com/t/store-data-with-multiple-rows/16835/3 "2022-11-05T12:16:22Z")

</div>

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