def team_singular_general(request, team): helper = RelayFunctions() cool = helper.team_candles(team) response = json.dumps(cool) return HttpResponse(response, mimetype="application/json")
def all_team_candles_general(request): helper = RelayFunctions() all_team_candles = [] for company in Company.objects.filter(company_type = 'RT'): for team in Team.objects.filter(company = company): if team.signup == True: all_team_candles.append(helper.team_candles(model_to_dict(team)['id'])) newlist = sorted(all_team_candles, key=itemgetter('team_candles_total'), reverse = True) #currPos = 1 #for item in newlist: #['pos'] = currPos #currPos = currPos + 1 response = json.dumps(newlist) return HttpResponse(response, mimetype="application/json")