Ejemplo n.º 1
0
 def get_leader_teams(self, empty):
     """ Gets all of the teams you are leader of """
     user_email = get_user_email()
     response = Teams()
     query = RoseboticsTeam.query(RoseboticsTeam.leader == user_email)
     response.teams = [to_team_from_rosebotics(team) for team in query]
     return response
Ejemplo n.º 2
0
 def get_leader_teams(self, empty):
     """ Gets all of the teams you are leader of """
     user_email = get_user_email()
     response = Teams()
     query = RoseboticsTeam.query(RoseboticsTeam.leader == user_email)
     response.teams = [to_team_from_rosebotics(team) for team in query]
     return response
Ejemplo n.º 3
0
 def get_teams(self, empty):
     """ Gets the teams that you are a member or leader of """
     user_email = get_user_email()
     response = Teams()
     query = RoseboticsTeamMember.query(RoseboticsTeamMember.email == user_email)
     teams = [m.key.parent().get() for m in query if m.visibility != TeamVisibility.NOT_CHOSEN]
     query = RoseboticsTeam.query(RoseboticsTeam.leader == user_email)
     teams += [team for team in query]
     teams = remove_model_duplicates(teams)
     response.teams = [to_team_from_rosebotics(team_key, get_members=False) for team_key in teams]
     return response
Ejemplo n.º 4
0
 def get_teams(self, empty):
     """ Gets the teams that you are a member or leader of """
     user_email = get_user_email()
     response = Teams()
     query = RoseboticsTeamMember.query(
         RoseboticsTeamMember.email == user_email)
     teams = [
         m.key.parent().get() for m in query
         if m.visibility != TeamVisibility.NOT_CHOSEN
     ]
     query = RoseboticsTeam.query(RoseboticsTeam.leader == user_email)
     teams += [team for team in query]
     teams = remove_model_duplicates(teams)
     response.teams = [
         to_team_from_rosebotics(team_key, get_members=False)
         for team_key in teams
     ]
     return response