

def get_pokemon_genera(self, obj):
    results = PokemonSpeciesName.objects.filter(pokemon_species=obj)
    serializer = PokemonSpeciesNameSerializer(results, many=True, context=self.context)
    data = serializer.data
    genera = []
    for entry in data:
        if entry['genus']:
            del entry['name']
            genera.append(entry)
    return genera

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