#24055: Keep reference to view class for resolve()
--------------------------------+--------------------
     Reporter:  collinanderson  |      Owner:  nobody
         Type:  New feature     |     Status:  new
    Component:  Generic views   |    Version:  master
     Severity:  Normal          |   Keywords:
 Triage Stage:  Unreviewed      |  Has patch:  0
Easy pickings:  0               |      UI/UX:  0
--------------------------------+--------------------
 I have some pretty hacky code like this that I'd like to get rid of:

 {{{
 match = resolve(url_split)
 for cl in match.func.__closure__:
     if hasattr(cl.cell_contents, 'http_method_names'):
         view_class = cl.cell_contents
         # etc
     if hasattr(cl.cell_contents, 'admin_site'):
         admin = cl.cell_contents
         if not admin.has_change_permission(etc):
             etc
 }}}
 It would be great if we could keep a reference to the original view class
 in these cases.

--
Ticket URL: <https://code.djangoproject.com/ticket/24055>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.c9309777f50a8e8e8666746453e445d2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to