#20479: Adding the concept predicates in the Django url routing
-------------------------------------+-------------------------------------
     Reporter:  rach                 |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (URLs)          |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  urlresolver,         |             Triage Stage:
  predicates                         |  Someday/Maybe
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by rach):

 There is probably a better way to implement it and it's more in
 implementation to illustrate the concept to unloose the relationship
 between url routing and view lookup which are only one thing at this stage
 in Django.

 I m not fan of django-multiurl approach as it add one level of complexity
 at the url configuration level, but I agree that could be implemented
 following the same technique and wrap the urls into a container. I may
 implement it for my next django project.

 The usecases are numerous:

 - Organize function base view to treat XHR request
 - MultiForm submit on a same url
 - Build easily api from function base view to handle PUT/POST/GET/DELETE
 - create reusable condition to check url arguments without having to write
 crazy regexp
 - Call specific function base view base contentType
 - Not getting a MethodNotAllowed when it's not what you want
 - Call a specific view matter if the user is login or not ( ex: / ->
 welcom or home)
 ...

 More generics:

 - Organize code from function base view and get rid off redundant logic
 - Extending function base view without having to follow the Class Base
 view model

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20479#comment:3>
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/062.5f5d1970d498f62ab1c778dbf5015788%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to