Ticket #3362: httpresponsenocontent.patch

File httpresponsenocontent.patch, 621 bytes (added by afternoon@…, 18 years ago)

Add django.http.HttpResponseNoContent (status 204 response class)

  • django/http/__init__.py

     
    253253            raise Exception, "This %s instance cannot tell its position" % self.__class__
    254254        return sum([len(chunk) for chunk in self._container])
    255255
     256class HttpResponseNoContext(HttpResponse):
     257    def __init__(self):
     258        HttpResponse.__init__(self)
     259        self.status_code = 204
     260
    256261class HttpResponseRedirect(HttpResponse):
    257262    def __init__(self, redirect_to):
    258263        HttpResponse.__init__(self)
Back to Top