本文整理匯總了Python中filebrowser.settings.EXTENSIONS.get方法的典型用法代碼示例。如果您正苦於以下問題:Python EXTENSIONS.get方法的具體用法?Python EXTENSIONS.get怎麽用?Python EXTENSIONS.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類filebrowser.settings.EXTENSIONS
的用法示例。
在下文中一共展示了EXTENSIONS.get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from filebrowser.settings import EXTENSIONS [as 別名]
# 或者: from filebrowser.settings.EXTENSIONS import get [as 別名]
def __init__(self, max_length=None, min_length=None, site=None, directory=None, extensions=None, format=None, upload_to=None, temp_upload_dir=None, *args, **kwargs):
self.max_length, self.min_length = max_length, min_length
self.site = kwargs.pop('filebrowser_site', site)
self.directory = directory
self.format = format or ''
self.extensions = extensions or EXTENSIONS.get(format.title())
self.upload_to = upload_to
self.temp_upload_dir = temp_upload_dir
super(FileBrowseAndUploadFormField, self).__init__(*args, **kwargs)
示例2: __init__
# 需要導入模塊: from filebrowser.settings import EXTENSIONS [as 別名]
# 或者: from filebrowser.settings.EXTENSIONS import get [as 別名]
def __init__(self, max_length=None, min_length=None, site=None, directory=None, extensions=None, format=None, *args, **kwargs):
self.max_length, self.min_length = max_length, min_length
self.site = kwargs.pop('filebrowser_site', site)
self.directory = directory
self.extensions = extensions
if format:
self.format = format or ''
self.extensions = extensions or EXTENSIONS.get(format)
super(FileBrowseFormField, self).__init__(*args, **kwargs)
示例3: __init__
# 需要導入模塊: from filebrowser.settings import EXTENSIONS [as 別名]
# 或者: from filebrowser.settings.EXTENSIONS import get [as 別名]
def __init__(self, max_length=None, min_length=None,
extensions=None, format=None, *args, **kwargs):
self.max_length, self.min_length = max_length, min_length
self.directory = kwargs.pop('directory', '')
self.extensions = extensions
self.format = format or ''
self.extensions = extensions or EXTENSIONS.get(format)
attrs = {
"directory": self.directory,
"extensions": self.extensions,
"format": self.format
}
self.widget = FileBrowseWidget(attrs)
super(FileBrowseFormField, self).__init__(*args, **kwargs)