I think I prefer documenting Berker's suggestion rather than adding more 
classes to Django, unless perhaps, they add some additional functionality 
as HttpResponseNoContent does.

Did you intend to have response subclasses for all 57 values of 
http.HTTPStatus?

On Sunday, August 6, 2017 at 4:17:22 PM UTC-4, Adam Johnson wrote:
>
> I've made a ticket for this: https://code.djangoproject.com/ticket/28469
>
> On 7 April 2017 at 11:18, Berker Peksağ <berker...@gmail.com <javascript:>
> > wrote:
>
>> On Fri, Apr 7, 2017 at 9:54 AM, Adam Johnson <m...@adamj.eu <javascript:>> 
>> wrote:
>> > Personally I'd be in favour of adding such classes. It seems against the
>> > batteries-included philosophy that Django does not provide all of the
>> > standard codes as classes. I can never remember which codes correspond 
>> to
>> > which response types, if I saw status=204 in code it would be a 'magic
>> > number' for me and I'd have to look it up. HttpResponseRedirect and
>> > HttpResponsePermanentRedirect have been my friends in the past, I can
>> > imagine the same for HttpResponseNoContent.
>>
>> Alternatively, they can use the HTTPStatus enum from the stdlib if
>> they are on Python 3.5+:
>>
>>     from http import HTTPStatus
>>
>>     HttpResponse(status=HTTPStatus.NO_CONTENT)
>>
>> --Berker
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers  (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-develop...@googlegroups.com <javascript:>.
>> To post to this group, send email to django-d...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/django-developers.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-developers/CAF4280K-fT8bRnc6fvpZj0RjuhK8b2-eSozMKEJMsPT0EinevQ%40mail.gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Adam
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/54f2537f-5c5a-4d3c-99b1-90630bc5b34f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to