rollerverbrauch/app/routes/misc.py

23 lines
534 B
Python

from flask import render_template
from flask_security import login_required
from flask_security.core import current_user
from ..tools import VehicleStats
from .. import app
@app.route('/statistics', methods=['GET'])
@login_required
def get_statistics():
stats = []
for vehicle in current_user.vehicles:
stats.append(VehicleStats(vehicle))
return render_template('statistics.html', data=stats)
@app.route('/manual', methods=['GET'])
@login_required
def get_manual():
return render_template('manual.html')