def get_districtteam_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that references this eventteam
        """

        return cls._queries_to_cache_keys_and_controllers(
            get_affected_queries.districtteam_updated(affected_refs))
Esempio n. 2
0
    def get_districtteam_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that references this eventteam
        """
        district_keys = affected_refs['district_key']
        team_keys = affected_refs['team']

        return cls._get_districtteams_cache_keys_and_controllers(district_keys, team_keys) + \
            cls._queries_to_cache_keys_and_controllers(get_affected_queries.districtteam_updated(affected_refs))
    def get_districtteam_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that references this eventteam
        """
        district_keys = affected_refs['district_key']
        team_keys = affected_refs['team']

        return cls._get_districtteams_cache_keys_and_controllers(district_keys, team_keys) + \
            cls._queries_to_cache_keys_and_controllers(get_affected_queries.districtteam_updated(affected_refs))
    def test_districtteam_updated(self):
        affected_refs = {
            'district_key': {'2015fim', '2015mar'},
            'team': {ndb.Key(Team, 'frc254'), ndb.Key(Team, 'frc604')}
        }
        cache_keys = [q.cache_key for q in get_affected_queries.districtteam_updated(affected_refs)]

        self.assertEqual(len(cache_keys), 4)
        self.assertTrue(DistrictTeamsQuery('2015fim').cache_key in cache_keys)
        self.assertTrue(DistrictTeamsQuery('2015mar').cache_key in cache_keys)
        self.assertTrue(TeamDistrictsQuery('frc254').cache_key in cache_keys)
        self.assertTrue(TeamDistrictsQuery('frc604').cache_key in cache_keys)
    def test_districtteam_updated(self):
        affected_refs = {
            'district_key': {ndb.Key(District, '2015fim'), ndb.Key(District, '2015mar')},
            'team': {ndb.Key(Team, 'frc254'), ndb.Key(Team, 'frc604')}
        }
        cache_keys = [q.cache_key for q in get_affected_queries.districtteam_updated(affected_refs)]

        self.assertEqual(len(cache_keys), 4)
        self.assertTrue(DistrictTeamsQuery('2015fim').cache_key in cache_keys)
        self.assertTrue(DistrictTeamsQuery('2015mar').cache_key in cache_keys)
        self.assertTrue(TeamDistrictsQuery('frc254').cache_key in cache_keys)
        self.assertTrue(TeamDistrictsQuery('frc604').cache_key in cache_keys)
    def get_districtteam_cache_keys_and_controllers(cls, affected_refs):
        """
        Gets cache keys and controllers that references this eventteam
        """

        return cls._queries_to_cache_keys_and_controllers(get_affected_queries.districtteam_updated(affected_refs))