本文整理汇总了Python中july.game.models.Game.active方法的典型用法代码示例。如果您正苦于以下问题:Python Game.active方法的具体用法?Python Game.active怎么用?Python Game.active使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类july.game.models.Game
的用法示例。
在下文中一共展示了Game.active方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_game
# 需要导入模块: from july.game.models import Game [as 别名]
# 或者: from july.game.models.Game import active [as 别名]
def get_game(self):
year = int(self.kwargs.get('year', 0))
month = int(self.kwargs.get('month', 0))
if not year:
game = Game.active()
else:
date = datetime.datetime(year=year, month=month, day=15)
game = Game.active(now=date)
if game is None:
game = Game.objects.latest()
return game
示例2: test_not_active
# 需要导入模块: from july.game.models import Game [as 别名]
# 或者: from july.game.models.Game import active [as 别名]
def test_not_active(self):
self.make_game(start=self.tomorrow, end=self.late)
active = Game.active()
self.assertEqual(active, None)
示例3: test_active
# 需要导入模块: from july.game.models import Game [as 别名]
# 或者: from july.game.models.Game import active [as 别名]
def test_active(self):
game = self.make_game()
active = Game.active()
self.assertEqual(active, game)