

def get_pokemon_held_items(self, obj):
    pokemon_items = PokemonItem.objects.filter(pokemon_id=obj).order_by('item_id')
    item_ids = pokemon_items.values('item_id').distinct()
    item_list = []
    for id in item_ids:
        pokemon_item_details = OrderedDict()
        item_object = Item.objects.get(pk=id['item_id'])
        item_data = ItemSummarySerializer(item_object, context=self.context).data
        pokemon_item_details['item'] = item_ids
        pokemon_item_objects = pokemon_items.filter(item_id=id['item_id'])
        serializer = PokemonItemSerializer(pokemon_item_objects, many=True, context=self.context)
        pokemon_item_details['version_details'] = []
        for item in serializer.data:
            version_detail = OrderedDict()
            version_detail['rarity'] = item['rarity']
            version_detail['version'] = item['version']
            pokemon_item_details['version_details'].append(version_detail)
        item_list.append(pokemon_item_details)
    return item_list

dataset/ETHPy150Open phalt/pokeapi/pokemon_v2/serializers.py PokemonDetailSerializer.get_pokemon_held_items/VarMisuse@97/150 `item_data`->`item_ids`