text: from rest_framework.views import APIView
  from rest_framework.response import Response
  from rest_framework import generics
  from .models import *
  from .serializers import *
  
  
  class WarriorAPIView(APIView):
      def get(self, request):
          warriors = Warrior.objects.all()
          serializer = WarriorSerializer(warriors, many=True)
          return Response({"Warriors": serializer.data})
  
  
  class WarriorListSkillsAPIView(generics.ListAPIView):
      serializer_class = WarriorSkillsNestedSerializer
      queryset = Warrior.objects.all()
  
  
  class WarriorListProfessionsAPIView(generics.ListAPIView):
      serializer_class = WarriorProfessionsNestedSerializer
      queryset = Warrior.objects.all()
  
  
  class SkillsAPIView(APIView):
      def get(self, request):
          skills = Skill.objects.all()
          serializer = SkillSerializer(skills, many=True)
          return Response({"Skills": serializer.data})
  
  
  class SkillCreateView(APIView):
      def post(self, request):
          skill = request.data.get("skill")
          serializer = SkillCreateSerializer(data=skill)
  
          if serializer.is_valid(raise_exception=True):
              skill_saved = serializer.save()
  
          return Response({"Success": "Skill '{}' created succesfully.".format(skill_saved.title)})
  
  
  class DetailWarriorView(generics.RetrieveUpdateDestroyAPIView):
      serializer_class = WarriorSerializer
      queryset = Warrior.objects.all()
      lookup_field = "id"
  