Last active
October 25, 2018 08:38
-
-
Save esirK/422fa3b7a6c1fc625b3d2dae6f8d01d6 to your computer and use it in GitHub Desktop.
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
| def delete(self, request, pk): | |
| # Get object with this pk | |
| article = get_object_or_404(Article.objects.all(), pk=pk) | |
| article.delete() | |
| return Response({"message": "Article with id `{}` has been deleted.".format(pk)},status=204) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment