

def get_encounters(self, obj):
    pal_park_objects = PalPark.objects.filter(pokemon_species=obj)
    parks = PalParkSerializer(pal_park_objects, many=True, context=self.context).data
    encounters = []
    for encounter in parks:
        del encounter['pokemon_species']
        encounters.append(encounter)
    return encounters

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py PokemonSpeciesDetailSerializer.get_encounters/original