Skip to content

Commit

Permalink
26.04.2022
Browse files Browse the repository at this point in the history
  • Loading branch information
fifthaccess committed Apr 26, 2022
1 parent 68e6b60 commit 0cf861f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
24 changes: 24 additions & 0 deletions controllers/kuenster.py
Original file line number Diff line number Diff line change
@@ -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")
29 changes: 29 additions & 0 deletions forms/kuenstler.py
Original file line number Diff line number Diff line change
@@ -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]

2 changes: 1 addition & 1 deletion templates/manager/editmanager.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{%block body%}


<button onclick= "window.location.href='/managers'">🔙Leave</button>
<button class="btn btn-warning" onclick= "window.location.href='/managers'">🔙Leave</button>

<form method="POST">
{{form.csrf_token}}
Expand Down
1 change: 1 addition & 0 deletions templates/manager/viewmanagers.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
data-bs-toggle="dropdown" aria-expanded="false">
Optionen
</a>

<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/">Hauptseite</a></li>
<li><a class="dropdown-item" href="/managers">View Managers</a></li>
Expand Down

0 comments on commit 0cf861f

Please sign in to comment.