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


Python WorkshopGame.get_question_category方法代码示例

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


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

示例1: schedule_change

# 需要导入模块: from models import WorkshopGame [as 别名]
# 或者: from models.WorkshopGame import get_question_category [as 别名]
def schedule_change(request, schedule=None):
    class SCForm(forms.ModelForm):
        class Meta:
            model = Schedule
            fields = ('name', 'start_date', 'end_date')

    if schedule:
        schedule = get_object_or_404(Schedule, pk=schedule)

    if request.method == 'POST':
        form = SCForm(request.POST, instance=schedule)
        if form.is_valid():
            sc = form.save()
            sc.category = WorkshopGame.get_question_category()
            sc.save()
            return redirect('ws_schedule')
    else:
        form = SCForm(instance=schedule)

    return render_to_response('workshop/cpanel/schedule_change.html',
                        {'module': 'workshop',
                         'form': form,
                         'instance': schedule},
                        context_instance=RequestContext(request)
    )
开发者ID:alexef,项目名称:wouso-1,代码行数:27,代码来源:cpanel.py

示例2: schedule

# 需要导入模块: from models import WorkshopGame [as 别名]
# 或者: from models.WorkshopGame import get_question_category [as 别名]
def schedule(request):
    schedules = Schedule.objects.all().order_by('start_date', 'name')

    return render_to_response('workshop/cpanel/schedule.html',
                        {'module': 'workshop',
                         'schedules': schedules,
                         'category': WorkshopGame.get_question_category(),
                         'page': 'schedule'},
                        context_instance=RequestContext(request)
    )
开发者ID:AndreiRO,项目名称:wouso,代码行数:12,代码来源:cpanel.py

示例3: schedule_change

# 需要导入模块: from models import WorkshopGame [as 别名]
# 或者: from models.WorkshopGame import get_question_category [as 别名]
def schedule_change(request, schedule=None):
    if schedule:
        schedule = get_object_or_404(Schedule, pk=schedule)

    if request.method == 'POST':
        form = SCForm(request.POST, instance=schedule)
        if form.is_valid():
            sc = form.save()
            sc.category = WorkshopGame.get_question_category()
            sc.save()
            return redirect('ws_schedule')
    else:
        form = SCForm(instance=schedule)

    return render_to_response('workshop/cpanel/schedule_change.html',
                        {'module': 'workshop',
                         'form': form,
                         'instance': schedule,
                         'page': 'schedule'},
                        context_instance=RequestContext(request)
    )
开发者ID:cvicentiu,项目名称:wouso,代码行数:23,代码来源:cpanel.py

示例4: form_valid

# 需要导入模块: from models import WorkshopGame [as 别名]
# 或者: from models.WorkshopGame import get_question_category [as 别名]
 def form_valid(self, form):
     sc = form.save()
     sc.category = WorkshopGame.get_question_category()
     sc.save()
     return redirect('ws_schedule')
开发者ID:AndreiRO,项目名称:wouso,代码行数:7,代码来源:cpanel.py


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