stranck-dev #5
4
stats.py
4
stats.py
|
@ -7,7 +7,7 @@ bp = Blueprint("stats", url_prefix="/manage")
|
||||||
@bp.route("/sponsorcount")
|
@bp.route("/sponsorcount")
|
||||||
async def sponsor_count(request, order: Order):
|
async def sponsor_count(request, order: Order):
|
||||||
await request.app.ctx.om.updateCache()
|
await request.app.ctx.om.updateCache()
|
||||||
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']}
|
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: x[1].ans('fursona_name')) if value.status not in ['c', 'e']}
|
||||||
|
|
||||||
tpl = request.app.ctx.tpl.get_template('sponsorcount.html')
|
tpl = request.app.ctx.tpl.get_template('sponsorcount.html')
|
||||||
return html(tpl.render(orders=orders, order=order))
|
return html(tpl.render(orders=orders, order=order))
|
||||||
|
@ -23,7 +23,7 @@ async def nose_count(request, order: Order):
|
||||||
@bp.route("/fursuitcount")
|
@bp.route("/fursuitcount")
|
||||||
async def fursuit_count(request, order: Order):
|
async def fursuit_count(request, order: Order):
|
||||||
await request.app.ctx.om.updateCache()
|
await request.app.ctx.om.updateCache()
|
||||||
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']}
|
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: x[1].ans('fursona_name')) if value.status not in ['c', 'e']}
|
||||||
|
|
||||||
tpl = request.app.ctx.tpl.get_template('fursuitcount.html')
|
tpl = request.app.ctx.tpl.get_template('fursuitcount.html')
|
||||||
return html(tpl.render(orders=orders, order=order))
|
return html(tpl.render(orders=orders, order=order))
|
Loading…
Reference in New Issue