本文整理汇总了Python中app.helpers.data.DataManager.add_speaker_to_session方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.add_speaker_to_session方法的具体用法?Python DataManager.add_speaker_to_session怎么用?Python DataManager.add_speaker_to_session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.helpers.data.DataManager
的用法示例。
在下文中一共展示了DataManager.add_speaker_to_session方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_speaker_view
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import add_speaker_to_session [as 别名]
def add_speaker_view(event_id, session_id):
event = DataGetter.get_event(event_id)
if not event.has_session_speakers:
return render_template('gentelella/users/events/info/enable_module.html', active_page='sessions',
title='Sessions', event=event)
form_elems = DataGetter.get_custom_form_elements(event_id)
if not form_elems:
flash("Speaker form has been incorrectly configured for this event. Editing has been disabled", "danger")
return redirect(url_for('.index_view', event_id=event_id))
speaker_form = json.loads(form_elems.speaker_form)
if request.method == 'GET':
return render_template('gentelella/users/events/speakers/edit.html', event_id=event_id,
event=event, speaker_form=speaker_form)
if request.method == 'POST':
DataManager.add_speaker_to_session(request, event_id, session_id)
flash("The speaker has been added to session")
return redirect(url_for('.index_view', event_id=event_id))