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


Python DBSession.add_all方法代码示例

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


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

示例1: save

# 需要导入模块: from mediacore.model import DBSession [as 别名]
# 或者: from mediacore.model.DBSession import add_all [as 别名]
    def save(self, email, legal_wording, default_wording, **kwargs):
        """Save :class:`~mediacore.forms.settings.SettingsForm`.

        Redirects back to :meth:`edit` after successful editing.

        """
        settings = self._fetch_keyed_settings()
        settings['email_media_uploaded'].value = email['media_uploaded']
        settings['email_comment_posted'].value = email['comment_posted']
        settings['email_support_requests'].value = email['support_requests']
        settings['email_send_from'].value = email['send_from']
#        settings['ftp_server'].value = ftp['server']
#        settings['ftp_username'].value = ftp['username']
#        if ftp['password'] is not None and ftp['password'] != '':
#            settings['ftp_password'].value = ftp['password']
#        settings['ftp_upload_path'].value = ftp['upload_path']
#        settings['ftp_download_url'].value = ftp['download_url']
        settings['wording_user_uploads'].value = legal_wording['user_uploads']
        settings['wording_additional_notes'].value = default_wording['additional_notes']

        DBSession.add_all(settings.values())
        DBSession.flush()
        redirect(action='edit')
开发者ID:SergeyLashin,项目名称:mediacore,代码行数:25,代码来源:settingadmin.py


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