Add function dashboard added

This commit is contained in:
gavinvanderbij
2025-05-14 12:10:10 +02:00
parent 351e6d2cd5
commit c9eb18fd0b
6 changed files with 73 additions and 8 deletions

View File

@@ -1,3 +1,33 @@
from flask import Blueprint
from flask import Blueprint, render_template
from flask_login import login_required
from application.models import AllowedPlate, LoggedItem
from application import db, app
from application.dashboard.forms import npForm
dash_blueprint = Blueprint("dash", __name__, template_folder="templates")
@dash_blueprint.route('/dashboard')
#@login_required
def dashboard():
form = LoggedItem.query.all()
return render_template("dashboard.html", form=form)
@dash_blueprint.route('/add', methods=['GET', 'POST'])
#@login_required
def add():
form = npForm()
if form.validate_on_submit():
if form.numberplate.data:
print(form.numberplate.data)
ap = AllowedPlate(plate=form.numberplate.data)
db.session.add(ap)
db.session.commit()
return render_template("add.html", form=form)