tomchristie/django-rest-framework — pull request #1541 by foresmac (2014-04-22 21:47:04+00:00)
Title: Added convenience constants for common codes

Many response codes are used often enough that typing `status=status.HTTP_400_BAD_REQUEST` can become extremely tedious. I propose adding several convince constants for common response codes in order to save typing while maintaining semantics for code readability.

Since all the existing predefined constants start with `HTTP_`, code completion doesn't help much here, and my proposed additions would save at least 9 keystrokes in many cases.

Further, importing using the following pattern could save even more:

``` python
from rest_framework.status import OK, NOT_FOUND
from rest_framework.response import Response

def get(request):
data = "Some data"
if data:
return Response(data, status=OK)
return Response("Error", status=NOT_FOUND)
```