1
0
mirror of https://github.com/daniviga/bite.git synced 2024-11-22 21:16:12 +01:00

Fix first and last sample

This commit is contained in:
Daniele Viganò 2020-06-30 22:35:20 +02:00
parent fe61ebbd9d
commit b1d0f35cf7
Signed by: dani
GPG Key ID: DB49AFC03C40EE02

View File

@ -47,9 +47,9 @@ class TelemetrySummaryView(APIView):
if count == 0: if count == 0:
raise Http404 raise Http404
first = Telemetry.objects.filter( first = Telemetry.objects.filter(
device__serial=device).order_by('-time')[:1][0]
last = Telemetry.objects.filter(
device__serial=device).order_by('time')[:1][0] device__serial=device).order_by('time')[:1][0]
last = Telemetry.objects.filter(
device__serial=device).order_by('-time')[:1][0]
data = { data = {
'device': device, 'device': device,
'stats': { 'stats': {