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())
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())