def team_skills(self): ''' Returns team details in JSON form ''' uuid = self.get_argument('uuid', '') if uuid == '': user = self.get_current_user() if user: team = user.team else: team = Team.by_uuid(uuid) if team is not None: categories = Category.all() catlist = {} for cat in categories: catbox = Box.by_category(cat.id) if (len(catbox) > 0): catlist[int(cat.id)] = 0 for flag in team.flags: box = flag.box if box and box.category_id is not None: catlist[int(box.category_id)] += 1 skillvalues = [] for val in catlist: skillvalues.append(catlist[val]) self.write(str(skillvalues)) else: self.write({'error': 'Team does not exist'}) self.finish()