当前位置: 首页>>代码示例>>Python>>正文


Python DataManager.edit_speaker方法代码示例

本文整理汇总了Python中app.helpers.data.DataManager.edit_speaker方法的典型用法代码示例。如果您正苦于以下问题:Python DataManager.edit_speaker方法的具体用法?Python DataManager.edit_speaker怎么用?Python DataManager.edit_speaker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.helpers.data.DataManager的用法示例。


在下文中一共展示了DataManager.edit_speaker方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_speaker_view

# 需要导入模块: from app.helpers.data import DataManager [as 别名]
# 或者: from app.helpers.data.DataManager import edit_speaker [as 别名]
def process_speaker_view(speaker_id):
    if request.method == 'GET':
        speaker = DataGetter.get_speaker(speaker_id)
        if not speaker or speaker.name == '':
            abort(404)
        form_elems = DataGetter.get_custom_form_elements(speaker.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=speaker.event_id))
        speaker_form = json.loads(form_elems.speaker_form)
        event = DataGetter.get_event(speaker.event_id)
        return render_template(
            'gentelella/users/mysessions/mysession_speaker_edit.html',
            photo_delete_url=url_for('.avatar_delete',
            event_id=event.id,
            speaker_id=speaker.id),
            speaker_form=speaker_form,
            event=event,
            speaker=speaker)

    if request.method == 'POST':
        speaker = DataGetter.get_speaker(speaker_id)
        DataManager.edit_speaker(request, speaker)
        flash("The speaker has been updated successfully", "success")
        return redirect(url_for('.display_my_sessions_view', event_id=speaker.event_id))
开发者ID:SaptakS,项目名称:open-event-orga-server,代码行数:28,代码来源:my_sessions.py


注:本文中的app.helpers.data.DataManager.edit_speaker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。