Ejemplo n.º 1
0
    def test_repair(self):
        event_team = EventTeam.get_by_id("2011ct_frc177")
        self.assertEqual(event_team.year, None)

        broken_event_teams = EventTeam.query(EventTeam.year == None).fetch()
        self.assertGreater(len(broken_event_teams), 0)

        fixed_event_teams = EventTeamRepairer.repair(broken_event_teams)
        fixed_event_teams = EventTeamManipulator.createOrUpdate(fixed_event_teams)

        event_team = EventTeam.get_by_id("2011ct_frc177")
        self.assertEqual(event_team.year, 2011)
    def get(self):
        event_teams_keys = EventTeam.query(EventTeam.year == None).fetch(keys_only=True)
        event_teams = ndb.get_multi(event_teams_keys)

        event_teams = EventTeamRepairer.repair(event_teams)
        event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        # sigh. -gregmarra
        if type(event_teams) == EventTeam:
            event_teams = [event_teams]

        template_values = {"event_teams": event_teams}

        path = os.path.join(os.path.dirname(__file__), "../templates/math/eventteam_repair_do.html")
        self.response.out.write(template.render(path, template_values))
Ejemplo n.º 3
0
    def get(self):
        event_teams = EventTeam.query(EventTeam.year == None).fetch()

        event_teams = EventTeamRepairer.repair(event_teams)
        event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        # sigh. -gregmarra
        if type(event_teams) == EventTeam:
            event_teams = [event_teams]
        
        template_values = {
            'event_teams': event_teams,
        }
        
        path = os.path.join(os.path.dirname(__file__), '../templates/math/eventteam_repair_do.html')
        self.response.out.write(template.render(path, template_values))
Ejemplo n.º 4
0
    def get(self):
        event_teams_keys = EventTeam.query(EventTeam.year == None).fetch(keys_only=True)
        event_teams = ndb.get_multi(event_teams_keys)

        event_teams = EventTeamRepairer.repair(event_teams)
        event_teams = EventTeamManipulator.createOrUpdate(event_teams)

        # sigh. -gregmarra
        if type(event_teams) == EventTeam:
            event_teams = [event_teams]

        template_values = {
            'event_teams': event_teams,
        }

        path = os.path.join(os.path.dirname(__file__), '../templates/math/eventteam_repair_do.html')
        self.response.out.write(template.render(path, template_values))