#29750: Add a pre-dispatch() hook for class-based views
----------------------------------+------------------------------------
     Reporter:  François Freitag  |                    Owner:  nobody
         Type:  New feature       |                   Status:  new
    Component:  Generic views     |                  Version:  master
     Severity:  Normal            |               Resolution:
     Keywords:                    |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Carlton Gibson):

 The previous discussion on django-developers (that Simon linked) ended
 linking to this commit
 
https://github.com/ghickman/django/commit/ca2e6d68764c0f2215e43196b6e8e1daf2e8a6c4

 > Move the setting of args, kwargs & request on self into the nested
 `view` function in `as_view` so they are set before dispatch is
 called. This allows anyone wishing to put pre-dispatch code in an
 overridden `dispatch` and still use the self versions of args, kwargs
 and request.

 Comments such as:

 > +1, this looks like a better solution than the hook method

 We have that. (The relevant attributes are set in `as_view()`).

 So, if we’re to add this now, the benefits that weren’t seen previously
 should be highlighted. (“Saves you creating a base view with the hook,
 since it’s already in place”, or such…)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29750#comment:6>
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/073.9d065db92a8e638944c14335cc554090%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to