diff --git a/controllers/kuenster.py b/controllers/kuenster.py new file mode 100644 index 0000000..5e28b2b --- /dev/null +++ b/controllers/kuenster.py @@ -0,0 +1,24 @@ +from ast import Del +from operator import index +from pyexpat import model +import string +from click import edit +from flask import Flask, redirect, request, flash +from flask.templating import render_template +from flask import Blueprint +import sqlalchemy +import sqlalchemy.orm +from model.models import Kuenstler, db +from forms.Manager import ManagerForm , DeleteManagerFrom, editManagerForm +from model.models import Manager + +kuenstler_blueprint = Blueprint('kuenstler_blueprint',__name__) + + +@kuenstler_blueprint.route("/kuenstler") +def manager_view(): + session : sqlalchemy.orm.scoping.scoped_session = db.session + + kuenstler = session.query(Kuenstler).order_by(Kuenstler.KuenstlerId).all() + + return render_template("manager/viewmanagers.html", managers = kuenstler, headline = "Managers") diff --git a/forms/kuenstler.py b/forms/kuenstler.py new file mode 100644 index 0000000..177c28d --- /dev/null +++ b/forms/kuenstler.py @@ -0,0 +1,29 @@ +from operator import imod +from flask_wtf import FlaskForm +from wtforms.fields.datetime import DateField +from wtforms.fields.simple import BooleanField, StringField, TextAreaField ,HiddenField +from wtforms.fields import DecimalField, FieldList , SelectField +from wtforms import validators +from model.models import Kuenstler +import sqlalchemy +import sqlalchemy.orm +from model.models import Manager +from model.models import db + +class KuenstlerForm(FlaskForm): + KuenstlerId = HiddenField("KuenstlerId") + ManagerID = HiddenField("ManagerID") + Vorname = StringField("Vorname") + Nachname = StringField("Nachname") + Herkunftsland = StringField("Herkunftsland") + Gehalt = DecimalField("Gehalt") + + +class UserDetails(FlaskForm): + group_id = SelectField('Group') + + #session : sqlalchemy.orm.scoping.scoped_session = db.session + #managers = session.query(Manager).order_by(Manager.ManagerId).all + + #form.group_id.choices = [(g.Vorname.data , g.Nachname.data) for g in managers] + diff --git a/templates/manager/editmanager.html b/templates/manager/editmanager.html index 73e1c7e..b75d986 100644 --- a/templates/manager/editmanager.html +++ b/templates/manager/editmanager.html @@ -3,7 +3,7 @@ {%block body%} - +
{{form.csrf_token}} diff --git a/templates/manager/viewmanagers.html b/templates/manager/viewmanagers.html index 0624611..5e61e2c 100644 --- a/templates/manager/viewmanagers.html +++ b/templates/manager/viewmanagers.html @@ -18,6 +18,7 @@ data-bs-toggle="dropdown" aria-expanded="false"> Optionen +