#22425: provide ability to abort URL resolution early
--------------------------------+--------------------------------------
     Reporter:  Chris Jerdonek  |                    Owner:  Tijani-Dia
         Type:  New feature     |                   Status:  assigned
    Component:  Core (URLs)     |                  Version:  dev
     Severity:  Normal          |               Resolution:
     Keywords:                  |             Triage Stage:  Accepted
    Has patch:  1               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------

Comment (by Chris Jerdonek):

 > What do you think about it?

 Instead of having two very similar arguments, I would just suggest having
 one. What about the following (similar to what I suggested above)?

 {{{#!python
 def include(arg, namespace=None, catch_all=False):
 }}}

 The `catch_all` argument can be either a boolean or a view. If true, it
 aborts early and uses the default catch-all view (e.g. the debug 404 page
 when debug is enabled). Otherwise, it would use the given view. I also
 think the view argument should just be a view (like what the related
 [https://docs.djangoproject.com/en/3.2/ref/urls/#django.urls.path path()]
 function accepts), rather than a string. I would need to look at the code
 more closely, but there's a chance a third option might be useful.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22425#comment:11>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.ca698f9b494562fd9188b107dd087b58%40djangoproject.com.

Reply via email to