本文整理汇总了Python中app.helpers.data.DataManager.edit_session方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.edit_session方法的具体用法?Python DataManager.edit_session怎么用?Python DataManager.edit_session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.helpers.data.DataManager
的用法示例。
在下文中一共展示了DataManager.edit_session方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_session_view
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import edit_session [as 别名]
def process_session_view(session_id):
if request.method == 'GET':
session = DataGetter.get_sessions_of_user_by_id(session_id)
if not session:
abort(404)
form_elems = DataGetter.get_custom_form_elements(session.event_id)
if not form_elems:
flash("Speaker and Session forms have been incorrectly configured for this event."
" Session creation has been disabled", "danger")
return redirect(url_for('.display_my_sessions_view', event_id=session.event_id))
speaker_form = json.loads(form_elems.speaker_form)
session_form = json.loads(form_elems.session_form)
event = DataGetter.get_event(session.event_id)
speaker = DataGetter.get_speakers(session.event_id).filter_by(user_id=login.current_user.id).first()
return render_template(
'gentelella/users/mysessions/mysession_detail_edit.html', session=session,
photo_delete_url=url_for('.avatar_delete', event_id=event.id, speaker_id=speaker.id),
speaker_form=speaker_form, session_form=session_form, event=event, speaker=speaker)
if request.method == 'POST':
session = DataGetter.get_sessions_of_user_by_id(session_id)
speaker = DataGetter.get_speakers(session.event_id).filter_by(user_id=login.current_user.id).first()
DataManager.edit_session(request, session, speaker)
flash("The session has been updated successfully", "success")
return redirect(url_for('.display_session_view', session_id=session_id))
示例2: edit_view
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import edit_session [as 别名]
def edit_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)
session = get_session_or_throw(session_id)
if request.method == 'POST':
DataManager.edit_session(request, session)
return redirect(url_for('.index_view', event_id=event_id))
form_elems = DataGetter.get_custom_form_elements(event_id)
if not form_elems:
flash("Speaker and Session forms have been incorrectly configured for this event."
" Session creation has been disabled", "danger")
return redirect(url_for('.index_view', event_id=event_id))
session_form = json.loads(form_elems.session_form)
speakers = DataGetter.get_speakers(event_id).all()
return render_template('gentelella/users/events/sessions/edit.html', session=session,
session_form=session_form, event=event, speakers=speakers)
示例3: process_session_view
# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import edit_session [as 别名]
def process_session_view(self, session_id):
session = DataGetter.get_sessions_of_user_by_id(session_id)
DataManager.edit_session(request, session)
flash("The session has been updated successfully", "success")
return redirect(url_for('.display_session_view', session_id=session_id))