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


Python forms.NewPackagedAppForm类代码示例

本文整理汇总了Python中mkt.developers.forms.NewPackagedAppForm的典型用法代码示例。如果您正苦于以下问题:Python NewPackagedAppForm类的具体用法?Python NewPackagedAppForm怎么用?Python NewPackagedAppForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: _upload

def _upload(request, addon=None, is_standalone=False):
    user = request.user
    # If there is no user, default to None (saves the file upload as anon).
    form = NewPackagedAppForm(request.POST, request.FILES, user=user if user.is_authenticated() else None, addon=addon)
    if form.is_valid():
        validator.delay(form.file_upload.pk)

    if addon:
        return redirect("mkt.developers.upload_detail_for_addon", addon.app_slug, form.file_upload.pk)
    elif is_standalone:
        return redirect("mkt.developers.standalone_upload_detail", "packaged", form.file_upload.pk)
    else:
        return redirect("mkt.developers.upload_detail", form.file_upload.pk, "json")
开发者ID:ngokevin,项目名称:zamboni,代码行数:13,代码来源:views.py

示例2: _upload

def _upload(request, addon=None, is_standalone=False):

    # If there is no user, default to None (saves the file upload as anon).
    form = NewPackagedAppForm(request.POST, request.FILES, user=getattr(request, "amo_user", None), addon=addon)
    if form.is_valid():
        tasks.validator.delay(form.file_upload.pk)

    if addon:
        return redirect("mkt.developers.upload_detail_for_addon", addon.app_slug, form.file_upload.pk)
    elif is_standalone:
        return redirect("mkt.developers.standalone_upload_detail", "packaged", form.file_upload.pk)
    else:
        return redirect("mkt.developers.upload_detail", form.file_upload.pk, "json")
开发者ID:rskumar,项目名称:zamboni,代码行数:13,代码来源:views.py

示例3: _upload

def _upload(request, addon_slug=None, is_standalone=False):
    # If there is no user, default to None (saves the file upload as anon).
    form = NewPackagedAppForm(request.POST, request.FILES,
                              user=getattr(request, 'amo_user', None))
    if form.is_valid():
        tasks.validator.delay(form.file_upload.pk)

    if addon_slug:
        return redirect('mkt.developers.upload_detail_for_addon',
                        addon_slug, form.file_upload.pk)
    elif is_standalone:
        return redirect('mkt.developers.standalone_upload_detail',
                        'packaged', form.file_upload.pk)
    else:
        return redirect('mkt.developers.upload_detail',
                        form.file_upload.pk, 'json')
开发者ID:bearstech,项目名称:zamboni,代码行数:16,代码来源:views.py


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