本文整理匯總了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)