forked from eric.li/EditionPN
Ajout ACs
This commit is contained in:
parent
016913078b
commit
92bb40d585
@ -31,6 +31,8 @@ class ACForm(Form):
|
||||
regex = "^AC\d{4}$"
|
||||
|
||||
code = StringField("Code", validators=[DataRequired(), Regexp("^AC\d{4}$", message="Le code doit être de la forme AC0000.")])
|
||||
titre = StringField("Titre", validators=[DataRequired()] )
|
||||
saes = StringField("SAEs", validators=[DataRequired()] )
|
||||
|
||||
|
||||
class SAEForm(Form):
|
||||
|
@ -23,7 +23,14 @@ def PN():
|
||||
|
||||
@app.route("/AC", methods=["GET","POST"])
|
||||
def AC():
|
||||
return render_template("PN.html", form = form)
|
||||
form = ACForm()
|
||||
form_validation = form.validate_on_submit()
|
||||
form = form_import(form)
|
||||
if form_validation and form.exporter.data:
|
||||
flash("Ajout du référentiel AC: {} ".format(form.code.data))
|
||||
form_export(form)
|
||||
return redirect(url_for("AC"))
|
||||
return render_template("AC.html", form = form)
|
||||
|
||||
@app.route("/SAE", methods=["GET","POST"])
|
||||
def SAE():
|
||||
|
13
app/templates/AC.html
Normal file
13
app/templates/AC.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "form.html" %}
|
||||
|
||||
{% block title %}AC Form{% endblock %}
|
||||
{% block form_title %}Formulaire d'Apprentissages Critiques (AC){% endblock %}
|
||||
|
||||
{% block formulaire %}
|
||||
|
||||
{{ render_field(form.code,"input") }}
|
||||
{{ render_field(form.titre,"input") }}
|
||||
{{ render_field(form.saes,"input") }}
|
||||
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user