#28294: self.request in views may not be documented yet
-------------------------------------+-------------------------------------
               Reporter:  Tony       |          Owner:  nobody
  Narlock                            |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:             |        Version:  1.11
  Documentation                      |
               Severity:  Normal     |       Keywords:  documentation views
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In the community, there is a convention of pulling HttpRequest from
 self.request. Especially due to the prominence of .as_view as a pattern to
 invoke views.

 This binding occurs in [https://docs.djangoproject.com/en/1.11/ref/class-
 based-views/base/#django.views.generic.base.View.as_view .as_view()]:
 https://github.com/django/django/blob/711123e/django/views/generic/base.py#L63

 CBV documentation doesn't mention it:
 https://docs.djangoproject.com/en/1.11/topics/class-based-views/intro/

 If a user is using .as_view() in a  high level view, they won't see
 HttpRequest being passed in as a method argument unless they're using
 [https://docs.djangoproject.com/en/1.11/ref/class-based-views/base/#view
 something like .get() or .post()]

 Documentation should be clarify where and how self.request in views comes
 into the life cycle of a view.

--
Ticket URL: <https://code.djangoproject.com/ticket/28294>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/047.2a32fddb839425a8499adc73c9a38814%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to