Created
May 7, 2019 10:12
-
-
Save akshar-raaj/a37f685ac4be6f2adf425ca676f64786 to your computer and use it in GitHub Desktop.
Question Detail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @api_view(['GET', 'PATCH', 'DELETE']) | |
| def question_detail_view(request, question_id): | |
| question = get_object_or_404(Question, pk=question_id) | |
| if request.method == 'GET': | |
| serializer = QuestionSerializer(question) | |
| return Response(serializer.data) | |
| elif request.method == 'PATCH': | |
| raise NotImplementedError("PATCH currently not supported") | |
| elif request.method == 'DELETE': | |
| raise NotImplementedError("DELETE currently not supported") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment