本文整理汇总了Python中flaskext.uploads.UploadSet.resolve_conflict方法的典型用法代码示例。如果您正苦于以下问题:Python UploadSet.resolve_conflict方法的具体用法?Python UploadSet.resolve_conflict怎么用?Python UploadSet.resolve_conflict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类flaskext.uploads.UploadSet
的用法示例。
在下文中一共展示了UploadSet.resolve_conflict方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SQLAlchemy
# 需要导入模块: from flaskext.uploads import UploadSet [as 别名]
# 或者: from flaskext.uploads.UploadSet import resolve_conflict [as 别名]
from flask.ext.sqlalchemy import SQLAlchemy
from flaskext.uploads import UploadSet, ALL
__all__ = ['db']
db = SQLAlchemy()
UploadSet.image_path = lambda self, dirname, filename: self.path('%s/%s' % (dirname, filename))
iscsi_images_store = UploadSet('iscsiImage', extensions=ALL,
default_dest=lambda app: app.config.get('ISCSI_IMAGES_STORE', '/dev/null')
)
iscsi_images_store.resolve_conflict = lambda target_folder, basename: basename
pxe_images_store = UploadSet('pxeImage', extensions=ALL,
default_dest=lambda app: app.config.get('PXE_IMAGES_STORE', '/dev/null')
)
pxe_images_store.resolve_conflict = lambda target_folder, basename: basename
kernels_store = UploadSet('kernel', extensions=ALL,
default_dest=lambda app: app.config.get('KERNELS_STORE', '/dev/null')
)
kernels_store.resolve_conflict = lambda target_folder, basename: basename