From 6a564fa020b3cdb11d214ac49e4f4d9a27d6ffb7 Mon Sep 17 00:00:00 2001 From: Chris Foresman Date: Tue, 22 Apr 2014 16:38:13 -0500 Subject: [PATCH] Added convenience constants for common codes --- rest_framework/status.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rest_framework/status.py b/rest_framework/status.py index 764353711..5773fca1f 100644 --- a/rest_framework/status.py +++ b/rest_framework/status.py @@ -68,3 +68,13 @@ HTTP_503_SERVICE_UNAVAILABLE = 503 HTTP_504_GATEWAY_TIMEOUT = 504 HTTP_505_HTTP_VERSION_NOT_SUPPORTED = 505 HTTP_511_NETWORK_AUTHENTICATION_REQUIRED = 511 + +# Some common responses with convenient shorthand constant names +OK = status.HTTP_200_OK +CREATED = status.HTTP_201_CREATED +UPDATED = status.HTTP_200_OK +DELETED = status.HTTP_204_NO_CONTENT +BAD_REQUEST = status.HTTP_400_BAD_REQUEST +NOT_FOUND = status.HTTP_404_NOT_FOUND +DUPLICATE = status.HTTP_409_CONFLICT +FORBIDDEN = status.HTTP_403_FORBIDDEN