Example #1
0
def journal():
    #app.logger.info("message")
    if request.method == 'POST':
        #app.logger.info('Post smth')
        Journal.insert(request.form['student'],
                       request.form['subject'],
                       request.form['mark'])
    return render_template('journal.html',
                           jrnl = Journal.get_all(),
                           students = Students.get_all(),
                           subjects = Subjects.get_all())
Example #2
0
def stat():
    studid = 1
    subjid = 1
    if request.method == 'POST':
        studid = int(request.form['student'])
        subjid = int(request.form['subject'])
        #app.logger.info("%s %s" %( studavg, subjavg))
    #else: studid = subjid =None
    studavg = Journal.st_avg(studid)
    subjavg = Journal.disc_avg(subjid)
    return render_template('stat.html',
                           students = Students.get_all(),
                           subjects = Subjects.get_all(),
                           studavg = studavg,
                           subjavg = subjavg,
                           studid = studid,
                           subjid = subjid)