Esempio n. 1
0
def display():
    from models import Subjects
    try:
        inserted = Subjects.insert(request.form['subjectCode'],
                                   request.form['term'],
                                   request.form['subjectType'],
                                   request.form['subjectName'])
    except:
        print("Empty fields")

    result = Subjects.select(all=True)
    return render_template("database.html", result=result)
Esempio n. 2
0
def subjectsTable():
  try:
    inserted = Subjects.insert( 
      request.form['subjectCode'],
      request.form['term'], 
      request.form['subjectType'], 
      request.form['subjectName'])
  except:
    print("Empty fields")
    
  allSubjects = Subjects.select(all=True)
  return render_template("subjectsTable.html", allSubjects=allSubjects)