haldis/app/views/stats.py

19 lines
493 B
Python
Raw Normal View History

2016-09-10 15:49:52 +02:00
from flask import render_template
2016-09-10 23:01:13 +02:00
from fatmodels import FatLocation, FatOrder, FatOrderItem, FatUser, FatProduct
2016-09-10 16:52:46 +02:00
from app import app
2016-09-10 15:49:52 +02:00
@app.route('/stats/')
def stats():
2016-09-10 16:52:46 +02:00
data = {
2016-09-10 23:01:13 +02:00
'amount': {
'orders': FatOrder.amount(),
'locations': FatLocation.amount(),
'users': FatUser.amount(),
'orderitems': FatOrderItem.amount(),
'products': FatProduct.amount(),
}
2016-09-10 16:52:46 +02:00
}
return render_template('stats.html', data=data)