miracle2k / djutils

My personal collection of small Django utilities and extensions.

Clone this repository (size: 392.9 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/miracle2k/djutils/
commit 146: 4cce764192db
parent 145: c35b31671423
branch: djutils
JsonResponse for some reason was not a HttpResponse subclass. Because the Gzip middleware in newer Django revisions apparently requires the status_code attribute, which we were missing for this reason, this bug came to light now.
Michael Elsdörfer / miracle2k
11 months ago

Changed (Δ6 bytes):

raw changeset »

djutils/__init__.py (1 lines added, 1 lines removed)

Up to file-list djutils/__init__.py:

@@ -141,7 +141,7 @@ def model_by_name(model_name):
141
141
from django.core.serializers import serialize
142
142
from django.utils import simplejson
143
143
from django.http import HttpResponse
144
class JsonResponse(object):
144
class JsonResponse(HttpResponse):
145
145
    """A subclass of HttpResponse useful as a shortcut in views; it
146
146
    chooses the correct JSON serializer based on whether or not it is
147
147
    passed a QuerySet.