aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/status.py
diff options
context:
space:
mode:
authorTom Christie2013-12-06 22:13:50 +0000
committerTom Christie2013-12-06 22:13:50 +0000
commit910de38a9c8cd03243e738c8f4adcbade8a4d7d6 (patch)
tree13c557324aae8b8738a98224d7ab3eef7aa11eef /rest_framework/status.py
parent85d9eb0f7ed3ef66a25a443b34ead914a506462c (diff)
downloaddjango-rest-framework-910de38a9c8cd03243e738c8f4adcbade8a4d7d6.tar.bz2
Version 2.3.102.3.10
Diffstat (limited to 'rest_framework/status.py')
-rw-r--r--rest_framework/status.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/rest_framework/status.py b/rest_framework/status.py
index b9f249f9..76435371 100644
--- a/rest_framework/status.py
+++ b/rest_framework/status.py
@@ -6,6 +6,23 @@ And RFC 6585 - http://tools.ietf.org/html/rfc6585
"""
from __future__ import unicode_literals
+
+def is_informational(code):
+ return code >= 100 and code <= 199
+
+def is_success(code):
+ return code >= 200 and code <= 299
+
+def is_redirect(code):
+ return code >= 300 and code <= 399
+
+def is_client_error(code):
+ return code >= 400 and code <= 499
+
+def is_server_error(code):
+ return code >= 500 and code <= 599
+
+
HTTP_100_CONTINUE = 100
HTTP_101_SWITCHING_PROTOCOLS = 101
HTTP_200_OK = 200