diff options
| author | Tom Christie | 2013-12-09 07:45:45 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-12-09 07:45:45 +0000 |
| commit | 80ef2685e522fc87bd8af9767aa7b231c9991ea4 (patch) | |
| tree | 4be3191af2eec42ffea97443c9e9f11ee5631ca7 /rest_framework/status.py | |
| parent | 4e9385e709bcee87456a99839841ecf6b56f337a (diff) | |
| parent | 175b4d233d578b5964db72f91a96bb3b4a0f3e99 (diff) | |
| download | django-rest-framework-80ef2685e522fc87bd8af9767aa7b231c9991ea4.tar.bz2 | |
Merge master
Diffstat (limited to 'rest_framework/status.py')
| -rw-r--r-- | rest_framework/status.py | 17 |
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 |
