本文整理汇总了Python中couchexport.models.SavedBasicExport.is_safe方法的典型用法代码示例。如果您正苦于以下问题:Python SavedBasicExport.is_safe方法的具体用法?Python SavedBasicExport.is_safe怎么用?Python SavedBasicExport.is_safe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类couchexport.models.SavedBasicExport
的用法示例。
在下文中一共展示了SavedBasicExport.is_safe方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _save_export_payload
# 需要导入模块: from couchexport.models import SavedBasicExport [as 别名]
# 或者: from couchexport.models.SavedBasicExport import is_safe [as 别名]
def _save_export_payload(files, saved_export, config, is_safe=False):
payload = files.file.payload
if not saved_export:
saved_export = SavedBasicExport(configuration=config)
else:
saved_export.configuration = config
saved_export.is_safe = is_safe
if saved_export.last_accessed is None:
saved_export.last_accessed = datetime.utcnow()
saved_export.last_updated = datetime.utcnow()
try:
saved_export.save()
except ResourceConflict:
# task was executed concurrently, so let first to finish win and abort the rest
pass
else:
saved_export.set_payload(payload)