本文整理匯總了Python中game.models.Game.minutes_per_round方法的典型用法代碼示例。如果您正苦於以下問題:Python Game.minutes_per_round方法的具體用法?Python Game.minutes_per_round怎麽用?Python Game.minutes_per_round使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類game.models.Game
的用法示例。
在下文中一共展示了Game.minutes_per_round方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: new_game
# 需要導入模塊: from game.models import Game [as 別名]
# 或者: from game.models.Game import minutes_per_round [as 別名]
def new_game(request):
form = GameForm()
if request.method == 'POST':
form = GameForm(request.POST)
if form.is_valid():
g = Game()
g.acronym = form.get_acronym()
g.max_players = int(form.cleaned_data['max_players'])
g.minutes_per_round = int(form.cleaned_data['minutes_per_round'])
g.save()
g.add_player(request.user)
return redirect('game.views.game', g.pk)
return render(request, 'new_game.html', form=form)