Example #1
0
def supply(request, page_name):
    """Supply view_objects contents, which are the player name, team and points."""
    _ = page_name
    profile = request.user.get_profile()
    name = profile.name
    team = profile.team
    points = score_mgr.player_points(profile)
    return {
        "name": name,
        "team": team,
        "points": points,
    }
Example #2
0
def supply(request, page_name):
    """Supply view_objects content, which is the set of team members."""
    _ = page_name

    # Get the team members.
    team = request.user.get_profile().team
    if team:
        members_with_points = []
        zero_point_members = []
        for member in team_mgr.team_members(team):
            if score_mgr.player_points(member) > 0:
                members_with_points.append(member)
            else:
                zero_point_members.append(member)
    else:
        members_with_points = None
        zero_point_members = None

    return {
        "team_members": members_with_points,
        "zero_members": zero_point_members,
        }
Example #3
0
 def points(self):
     """Returns the overall total number of points for the user."""
     return score_mgr.player_points(self, round_name="Overall")
Example #4
0
 def current_round_points(self):
     """Returns the total number of points for the user.  Optional parameter for a round."""
     current_round = challenge_mgr.get_round_name()
     return score_mgr.player_points(self, round_name=current_round)
Example #5
0
 def points(self):
     """Returns the overall total number of points for the user."""
     return score_mgr.player_points(self, round_name="Overall")
Example #6
0
 def current_round_points(self):
     """Returns the total number of points for the user.  Optional parameter for a round."""
     current_round = challenge_mgr.get_round_name()
     return score_mgr.player_points(self, round_name=current_round)
Example #7
0
 def points(self):
     """Returns the total number of points for the user.  Optional parameter for a round."""
     return score_mgr.player_points(self)