diff --git a/influx_frontend.py b/influx_frontend.py index 943ca41..2adb7e9 100644 --- a/influx_frontend.py +++ b/influx_frontend.py @@ -27,7 +27,7 @@ def success(): def main_page(): query_api = client.query_api() query = 'from(bucket: "gas")\ - |> range(start: -30d)\ + |> range(start: -90d)\ |> filter(fn: (r) => r["_measurement"] == "2016_odyssey")\ |> filter(fn: (r) => r["_field"] == "odometer")\ |> sort(columns: ["_value"], desc: false)\ @@ -50,6 +50,10 @@ def main_page(): temp['fuelcost'] = record['fuelcost'] except KeyError: pass + try: + temp['winter'] = record['winter'] + except KeyError: + pass results.append(temp) # .append((record.get_time(), record.get_field(), record.get_value())) newlist = sorted(results, key=itemgetter('time'), reverse=True)