예제 #1
0
def team_members(request):
    """Provide the team members."""
    team = request.user.get_profile().team
    if team:
        members = team_mgr.team_members(team)
    else:
        members = None

    return render_to_response("team_members.html", {
        "team_members": members,
        }, context_instance=RequestContext(request))
예제 #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,
        }