[Answered ]-AttributeError when trying to return Id from queryset

1👍

get_queryset should return a Queryset… hence the name. You are returning a list of ids which will not work. If you want to specify a certain set of fields to return, that should go in the serializer.

class ChessBSerializer(serializers.ModelSerializer):
    class Meta:
        model = ChessB
        fields = ("id",)

Leave a comment