def post(self, request): skill = request.data.get("skill") serializer = SkillSerializer(data=skill) if serializer.is_valid(raise_exception=True): skill_saved = serializer.save() return Response({"Success": "Skill '{}' created succesfully.".format(skill_saved.title)})
def get(self, request): skills = Skill.objects.all() serializer = SkillSerializer(skills, many=True) return Response({"Skills": serializer.data})