Esempio n. 1
0
 def get_some_data(self, get_request):
     """
     ITS VERYY VERYY BAD STYLEE
     """
     if 'subject' in get_request and 'room' in get_request and 'teacher' in get_request:
         return Response(Schedule.get_room_subject_teacher(get_request))
     
     elif 'subject' in get_request and 'teacher' in get_request:
         return Response(Schedule.get_subject_teacher(get_request))
     
     elif 'room' in get_request and 'teacher' in get_request:
         return Response(Schedule.get_room_teacher(get_request))
     
     elif 'subject' in get_request and 'room' in get_request:
         return Response(Schedule.get_room_subject(get_request))
     
     elif 'room' in get_request:
         return Response(Schedule.get_only_room(get_request))
     
     elif 'subject' in get_request:
         return Response(Schedule.get_only_subject(get_request))
     
     elif 'teacher' in get_request:
         return Response(Schedule.get_only_teacher(get_request))
     
     else:
         data = Schedule.objects.all()
         serializer = ScheduleSerializer(data, many=True)
         return Response(serializer.data)