Beispiel #1
0
def edit_speaker(speaker_id):
    query_edit_speaker = Speaker.query.filter(Speaker.id == speaker_id).first()
    form = AddSpeaker(obj=query_edit_speaker)
    action = url_for('admin.edit_speaker', speaker_id=speaker_id)
    if form.validate_on_submit():
        form.populate_obj(query_edit_speaker)
        db.session.commit()
        flash('Ponente actualizado')
        return redirect(url_for('admin.speakers'))
    return render_template('backend/speakers_actions.html',
                           title=u'Editar ponente',
                           form=form,
                           action=action)
Beispiel #2
0
def edit_speaker(speaker_id):
    query_edit_speaker = Speaker.query.filter(Speaker.id ==
                                              speaker_id).first()
    form = AddSpeaker(obj=query_edit_speaker)
    action = url_for('admin.edit_speaker', speaker_id=speaker_id)
    if form.validate_on_submit():
        form.populate_obj(query_edit_speaker)
        db.session.commit()
        flash('Ponente actualizado')
        return redirect(url_for('admin.speakers'))
    return render_template('backend/speakers_actions.html',
                           title=u'Editar ponente',
                           form=form,
                           action=action)
Beispiel #3
0
def add_speaker():
    """ Add speakers to the application
    """
    form = AddSpeaker()
    action = url_for('admin.add_speaker')
    if form.validate_on_submit():
        speaker = Speaker(names=form.names.data,
                          fas=form.fas.data,
                          bio=form.bio.data,
                          active=form.active.data)
        db.session.add(speaker)
        db.session.commit()
        flash('Ponente creado')
        return redirect(url_for('admin.speakers'))
    return render_template('backend/speakers_actions.html',
                           form=form,
                           title=u"Añadir speaker",
                           action=action)
Beispiel #4
0
def add_speaker():
    """ Add speakers to the application
    """
    form = AddSpeaker()
    action = url_for('admin.add_speaker')
    if form.validate_on_submit():
        speaker = Speaker(names=form.names.data,
                          fas=form.fas.data,
                          bio=form.bio.data,
                          active=form.active.data)
        db.session.add(speaker)
        db.session.commit()
        flash('Ponente creado')
        return redirect(url_for('admin.speakers'))
    return render_template('backend/speakers_actions.html',
                           form=form,
                           title=u"Añadir speaker",
                           action=action)