

def get_pokemon_egg_groups(self, obj):
    results = PokemonEggGroup.objects.filter(pokemon_species=obj)
    data = PokemonEggGroupSerializer(results, many=True, context=self.context).data
    groups = []
    for group in data:
        groups.append(group['egg_group'])
    return groups

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