'Attribute error 'int' object has no attribute 'items'

Attribute error 'int' object has no attribute 'items'

her my Modelserializer

 def validate(self, validated_data):
    gameevent = validated_data.get('gameevent')
    match_round =validated_data.get('match_round')
    if not match_round :
        raise serializers.ValidationError("Enter value more than 0 ")
    if match_round == 1:
        return match_round
    round = range(1,match_round)
    match = Matchscore.objects.filter(gameevent=gameevent,match_round__in=round).values_list('match_round',flat=True)
    match = set(match)
    if match :
        return validated_data
    else:
        raise serializers.ValidationError("Enter a valid match_round")
    
   
    


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source