diff options
Diffstat (limited to 'ustayml/views/dashboard.py')
| -rw-r--r-- | ustayml/views/dashboard.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ustayml/views/dashboard.py b/ustayml/views/dashboard.py index e69de29..0295c30 100644 --- a/ustayml/views/dashboard.py +++ b/ustayml/views/dashboard.py @@ -0,0 +1,37 @@ +import datetime +from flask import ( + Blueprint, flash, g, redirect, render_template, request, url_for +) +from werkzeug.exceptions import abort + +from ustayml.views.auth import login_required +from ustayml.db import get_db, get_paginated_rows, get_row + +bp = Blueprint('dashboard', __name__, url_prefix='/dashboard') + +@bp.route('/', methods=('GET', 'POST')) +@login_required +def index(): + db = get_db() + pucp_unit = db.execute("select * from pucp_unit;").fetchall() + semester = [{'id': x, 'name': x} for x in range(1, 13)] + desertion_risks_class = db.execute("select * from desertion_risk_class;").fetchall() + + # filter criteria | field choices + fc = { + 'pucp_unit': int(request.args.get('pucp_unit', 0)), + 'semester': int(request.args.get('semester', 0)), + 'desertion_risk_class': int(request.args.get('desertion_risk_class', 0)), + } + + return render_template( + 'dashboard/index.html', + # students=students, pagination=pagination, + pucp_unit=pucp_unit, + semester=semester, + desertion_risk_class=desertion_risks_class, + fc=fc + ) + return render_template( + 'dashboard/index.html' + ) |
