Beispiel #1
0
def edit(fonction_id=None):

    if fonction_id:
        grades = Fonction.get_by_id(fonction_id)
        form = FormFonction(obj=grades)
    else:
        grades = Fonction()
        form = FormFonction()

    success = False
    if form.validate_on_submit():

        grades.libelle = form.libelle.data
        grades.put()

        flash('Enregistement effectue avec succes', 'success')
        success = True

    return render_template('fonction/edit.html', **locals())
Beispiel #2
0
def edit(fonction_id=None):

    if fonction_id:
        grades = Fonction.objects.get(id=fonction_id)
        form = FormFonction(obj=grades)
    else:
        grades = Fonction()
        form = FormFonction()

    success = False
    if form.validate_on_submit():

        grades.libelle = form.libelle.data
        grades.save()

        flash('Enregistement effectue avec succes', 'success')
        success = True

    return render_template('fonction/edit.html', **locals())