Пример #1
0
 def edit_form(self, obj=None):
     form = super(CategoryGameAdmin, self).edit_form(obj)
     cids = Category.all_category_ids()
     categories = Category.get_list(cids)
     form.category.choices = [(c._id, c.name) for c in categories]
     form.game.choices = Game.online_games()
     return form
Пример #2
0
def online_games():
    """获取所有在线游戏列表 (GET)

    :uri: /games
    :return: {'games': list}
    """
    games = Game.online_games()
    gids = [str(gid) for gid, _ in games]
    games = [g.format() for g in Game.get_list(gids)]
    return {'games': games}
Пример #3
0
 def edit_form(self, obj=None):
     form = super(GameRecommendSubscribeAdmin, self).edit_form(obj)
     form.game.choices = Game.online_games()
     return form
Пример #4
0
 def edit_form(self, obj=None):
     form = super(GameActivityAdmin, self).edit_form(obj)
     form.game.choices = Game.online_games()
     form.activity.choices = ActivityConfig.activity()
     return form
Пример #5
0
 def create_form(self, obj=None):
     form = super(GameRecommendVideoAdmin, self).create_form(obj)
     form.game.choices = Game.online_games()
     return form