Compare commits
2 Commits
e8b41b402e
...
da166e5169
Author | SHA1 | Date | |
---|---|---|---|
|
da166e5169 | ||
|
526e6d3439 |
@ -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)
|
||||
|
@ -47,10 +47,18 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<label for="winter">Winter Tires:</label>
|
||||
<select name="winter" class="form-control" default="false">
|
||||
<option value="TRUE">True</option>
|
||||
<option value="FALSE" selected>False</option>
|
||||
</select>
|
||||
<select name="winter" class="form-control">
|
||||
{% if data %}
|
||||
{% if data[0]['winter'] == "True" %}
|
||||
<option value="TRUE" selected>True</option>
|
||||
<option value="FALSE">False</option>
|
||||
|
||||
{% else %}
|
||||
<option value="TRUE">True</option>
|
||||
<option value="FALSE" selected>False</option>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div><br>
|
||||
<input type="submit" value="Go">
|
||||
|
Loading…
Reference in New Issue
Block a user