

def get_pokemon_types(self, obj):
    poke_type_objects = PokemonType.objects.filter(pokemon=obj)
    poke_types = PokemonTypeSerializer(poke_type_objects, many=True, context=self.context).data
    for poke_type in poke_types:
        del poke_type['pokemon']
    return poke_types

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py PokemonDetailSerializer.get_pokemon_types/original