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


Python DownloadBase.get_start_response方法代码示例

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


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

示例1: export_all_form_metadata_async

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
def export_all_form_metadata_async(req, domain):
    datespan = req.datespan if req.GET.get("startdate") and req.GET.get("enddate") else None
    group_id = req.GET.get("group")
    ufilter =  UserTypeFilter.get_user_filter(req)[0]
    users = util.get_all_users_by_domain(
        domain=domain,
        group=group_id,
        user_filter=ufilter,
        simplified=True,
        include_inactive=True
    )
    user_ids = filter(None, [u["user_id"] for u in users])
    format = req.GET.get("format", Format.XLS_2007)
    filename = "%s_forms" % domain

    download = DownloadBase()
    download.set_task(create_metadata_export.delay(
        download.download_id,
        domain,
        format=format,
        filename=filename,
        datespan=datespan,
        user_ids=user_ids,
    ))
    return download.get_start_response()
开发者ID:bradmerlin,项目名称:commcare-hq,代码行数:27,代码来源:views.py

示例2: prepare_export

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
    def prepare_export(self, export_tags, export_filter):
        self.generate_bulk_files(export_tags, export_filter)

        download = DownloadBase()
        couchexport.tasks.bulk_export_async.delay(
            self,
            download.download_id,
            domain=self.domain
        )
        return download.get_start_response()
开发者ID:pawelreise,项目名称:commcare-hq,代码行数:12,代码来源:export.py

示例3: export_data_async

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
 def export_data_async(self, format=None, **kwargs):
     format = format or self.default_format
     download = DownloadBase()
     download.set_task(couchexport.tasks.export_async.delay(
         self,
         download.download_id,
         format=format,
         **kwargs
     ))
     return download.get_start_response()
开发者ID:nnestle,项目名称:commcare-hq,代码行数:12,代码来源:models.py

示例4: download_item_lists

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
def download_item_lists(request, domain):
    """Asynchronously serve excel download for edit_lookup_tables
    """
    download = DownloadBase()
    download.set_task(fixture_download_async.delay(
        prepare_fixture_download,
        table_ids=request.GET.getlist("table_id"),
        domain=domain,
        download_id=download.download_id,
    ))
    return download.get_start_response()
开发者ID:dslowikowski,项目名称:commcare-hq,代码行数:13,代码来源:views.py

示例5: export_all_form_metadata_async

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
def export_all_form_metadata_async(req, domain):
    format = req.GET.get("format", Format.XLS_2007)
    filename = "%s_forms" % domain
    download = DownloadBase()
    download.set_task(create_metadata_export.delay(
        download.download_id,
        domain,
        format=format,
        filename=filename,
    ))
    return download.get_start_response()
开发者ID:kennknowles,项目名称:commcare-hq,代码行数:13,代码来源:views.py

示例6: generate_payload

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
 def generate_payload(payload_func):
     if async:
         download = DownloadBase()
         a_task = prepare_download.delay(download.download_id, payload_func, content_disposition, mimetype)
         download.set_task(a_task)
         return download.get_start_response()
     else:
         payload = payload_func()
         response = HttpResponse(payload)
         response["Content-Type"] = mimetype
         response["Content-Disposition"] = content_disposition
         return response
开发者ID:hashimoto-hb,项目名称:commcare-hq,代码行数:14,代码来源:views.py

示例7: get

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
    def get(self, request, *args, **kwargs):
        assert self.include_multimedia_files or self.include_index_files
        error_response = self.check_before_zipping()
        if error_response:
            return error_response

        download = DownloadBase()
        download.set_task(build_application_zip.delay(
            include_multimedia_files=self.include_multimedia_files,
            include_index_files=self.include_index_files,
            app=self.app,
            download_id=download.download_id,
            compress_zip=self.compress_zip,
            filename=self.zip_name)
        )
        return download.get_start_response()
开发者ID:ekush,项目名称:commcare-hq,代码行数:18,代码来源:views.py

示例8: get

# 需要导入模块: from soil import DownloadBase [as 别名]
# 或者: from soil.DownloadBase import get_start_response [as 别名]
    def get(self, request, *args, **kwargs):
        assert self.include_multimedia_files or self.include_index_files
        error_response = self.check_before_zipping()
        if error_response:
            return error_response

        message = request.GET['message'] if 'message' in request.GET else None
        download = DownloadBase(message=message)
        build_profile_id = None
        if domain_has_privilege(request.domain, privileges.BUILD_PROFILES):
            build_profile_id = request.GET.get('profile')
        download.set_task(build_application_zip.delay(
            include_multimedia_files=self.include_multimedia_files,
            include_index_files=self.include_index_files,
            app=self.app,
            download_id=download.download_id,
            compress_zip=self.compress_zip,
            filename=self.zip_name,
            build_profile_id=build_profile_id)
        )
        return download.get_start_response()
开发者ID:saketkanth,项目名称:commcare-hq,代码行数:23,代码来源:views.py


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