11# Django timescaledb
22
3-
4-
53[ ![ PyPI version fury.io] ( https://badge.fury.io/py/django-timescaledb.svg )] ( https://pypi.python.org/pypi/django-timescaledb/ )
64
7-
8-
5+ ![ Workflow] ( https://github.com/schlunsen/django-timescaledb/actions/workflows/test.yml/badge.svg )
96
107A database backend and tooling for Timescaledb.
118
@@ -55,8 +52,8 @@ TIMESCALE_DB_BACKEND_BASE = "django.contrib.gis.db.backends.postgis"
5552
5653 class TimescaleModel (models .Model ):
5754 """
58- A helper class for using Timescale within Django, has the TimescaleManager and
59- TimescaleDateTimeField already present. This is an abstract class it should
55+ A helper class for using Timescale within Django, has the TimescaleManager and
56+ TimescaleDateTimeField already present. This is an abstract class it should
6057 be inheritted by another class for use.
6158 """
6259 time = TimescaleDateTimeField(interval = " 1 day" )
@@ -75,7 +72,7 @@ from timescale.db.models.models import TimescaleModel
7572
7673class Metric (TimescaleModel ):
7774 temperature = models.FloatField()
78-
75+
7976
8077```
8178
@@ -93,6 +90,7 @@ class Metric(models.Model):
9390```
9491
9592The name of the field is important as Timescale specific feratures require this as a property of their functions.
93+
9694### Reading Data
9795
9896"TimescaleDB hypertables are designed to behave in the same manner as PostgreSQL database tables for reading data, using standard SQL commands."
@@ -144,14 +142,14 @@ As such the use of the Django's ORM is perfectally suited to this type of data.
144142 .values(' device' )
145143 .histogram(field = ' temperature' , min_value = 50.0 , max_value = 55.0 , num_of_buckets = 10 )
146144 .annotate(Count(' device' )))
147-
145+
148146 # expected output
149147
150148 < TimescaleQuerySet [{' histogram' : [0 , 0 , 0 , 87 , 93 , 125 , 99 , 59 , 0 , 0 , 0 , 0 ], ' device__count' : 463 }]>
151149```
152150
153151## Contributors
154-
155- * [ Ben Cleary] ( https://github.com/bencleary )
156- * [ Jonathan Sundqvist] ( https://github.com/jonathan-s )
157- * [ Harsh Bhikadia] ( https://github.com/daadu )
152+ - [ Rasmus Schlünsen ] ( https://github.com/schlunsen )
153+ - [ Ben Cleary] ( https://github.com/bencleary )
154+ - [ Jonathan Sundqvist] ( https://github.com/jonathan-s )
155+ - [ Harsh Bhikadia] ( https://github.com/daadu )
0 commit comments