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


Python ChallengeGame.get_played方法代码示例

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


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

示例1: index

# 需要导入模块: from models import ChallengeGame [as 别名]
# 或者: from models.ChallengeGame import get_played [as 别名]
def index(request):
    """ Shows all challenges related to the current user """
    profile = request.user.get_profile()
    chall_user = profile.get_extension(ChallengeUser)

    challs = ChallengeGame.get_active(chall_user)
    played = ChallengeGame.get_played(chall_user)[:10]

    if not chall_user.is_eligible():
        return do_result(request, error='Ne pare rau, nu esti anul I, nu poti provoca. Te invitam pe wouso-next.rosedu.org')

    return render_to_response('challenge/index.html',
            {'challenges': challs, 'played': played, 'challuser': chall_user, 'challenge': ChallengeGame},
            context_instance=RequestContext(request))
开发者ID:anaion,项目名称:wouso,代码行数:16,代码来源:views.py

示例2: index

# 需要导入模块: from models import ChallengeGame [as 别名]
# 或者: from models.ChallengeGame import get_played [as 别名]
def index(request):
    """ Shows all challenges related to the current user """
    profile = request.user.get_profile()
    chall_user = profile.get_extension(ChallengeUser)

    challs = ChallengeGame.get_active(chall_user)
    played = ChallengeGame.get_played(chall_user)[:10]

    if not chall_user.is_eligible():
        messages.error(request, _('Your race can\'t play. Go home'))

    return render_to_response('challenge/index.html',
            {'challenges': challs, 'played': played, 'challuser': chall_user, 'challenge': ChallengeGame},
            context_instance=RequestContext(request))
开发者ID:AndreiRO,项目名称:wouso,代码行数:16,代码来源:views.py

示例3: index

# 需要导入模块: from models import ChallengeGame [as 别名]
# 或者: from models.ChallengeGame import get_played [as 别名]
def index(request):
    """ Shows all challenges related to the current user """
    profile = request.user.get_profile()
    chall_user = profile.get_extension(ChallengeUser)

    challs = ChallengeGame.get_active(chall_user)
    played = ChallengeGame.get_played(chall_user)[:10]

    if not chall_user.is_eligible():
        return do_result(request, error="Your race can't play. Go home")

    return render_to_response(
        "challenge/index.html",
        {"challenges": challs, "played": played, "challuser": chall_user, "challenge": ChallengeGame},
        context_instance=RequestContext(request),
    )
开发者ID:tiriplicamihai,项目名称:wouso,代码行数:18,代码来源:views.py


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