

def get_pokedex_version_groups(self, obj):
    dex_group_objects = PokedexVersionGroup.objects.filter(pokedex=obj)
    dex_groups = PokedexVersionGroupSerializer(dex_group_objects, many=True, context=self.context).data
    results = []
    for dex_group in dex_groups:
        results.append(dex_group['version_group'])
    return results

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py PokedexDetailSerializer.get_pokedex_version_groups/original