Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
schlunsen committed Dec 24, 2020
1 parent 105e716 commit 2a42609
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ As such the use of the Django's ORM is perfectally suited to this type of data.
#### Time Bucket [More Info](https://docs.timescale.com/latest/using-timescaledb/reading-data#time-bucket)

```python
Metric.timescale.filter(time__range=date_range).time_bucket('time', '1 hour')
Metric.objects.filter(time__range=date_range).time_bucket('time', '1 hour')

# expected output

@@ -107,7 +107,7 @@ As such the use of the Django's ORM is perfectally suited to this type of data.

ranges = (timezone.now() - timedelta(days=2), timezone.now())

(Metric.timescale
(Metric.objects
.filter(time__range=ranges)
.time_bucket_gapfill('time', '1 day', ranges[0], ranges[1])
.annotate(Avg('temperature')))

0 comments on commit 2a42609

Please sign in to comment.