aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/status.py
diff options
context:
space:
mode:
authorTom Christie2013-12-13 16:32:34 +0000
committerTom Christie2013-12-13 16:32:34 +0000
commit9c41c007afc71c899306bcb02e40bdfc36b09146 (patch)
treeca0da04aed0c1b96ddf14a801dc54b5a72a72461 /rest_framework/status.py
parented931b90ae9e72f963673e6e188b1802a5a65360 (diff)
parentca244ad614e2f6fb4fef1dc9987be996d2624303 (diff)
downloaddjango-rest-framework-9c41c007afc71c899306bcb02e40bdfc36b09146.tar.bz2
Merge branch 'master' into 2.4.0
Conflicts: .travis.yml docs/api-guide/routers.md docs/topics/release-notes.md rest_framework/compat.py
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