# Django with Timescale DB

**URL:** <https://forum.djangoproject.com/t/django-with-timescale-db/35761>\
**Category:** Using the ORM\
**Created:** [October 18, 2024, 7:05am UTC](https://forum.djangoproject.com/t/django-with-timescale-db/35761 "2024-10-18T07:05:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aneesh-bulls](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/aneesh-bulls/32/24667_2.png) [@Aneesh-bulls](https://forum.djangoproject.com/u/Aneesh-bulls)\
**Post date:** [October 18, 2024, 7:05am UTC](https://forum.djangoproject.com/t/django-with-timescale-db/35761/1 "2024-10-18T07:05:06Z")

</div>

I want to use timescale db with Django ORM for calculate open, high, low, close of particular time duration. How to do this there is no function available as time\_bucket (in raw sql) ?

---

<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:** [October 18, 2024, 12:35pm UTC](https://forum.djangoproject.com/t/django-with-timescale-db/35761/2 "2024-10-18T12:35:45Z")

</div>

Welcome @Aneesh-bulls !

You can create your own DB function definition. See [Database functions in Django](https://www.b-list.org/weblog/2023/dec/14/django-database-functions/).
