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
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}
def edit_form(self, obj=None): form = super(GameRecommendSubscribeAdmin, self).edit_form(obj) form.game.choices = Game.online_games() return form
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
def create_form(self, obj=None): form = super(GameRecommendVideoAdmin, self).create_form(obj) form.game.choices = Game.online_games() return form