Fwiw, I spent a little time investigating this a couple of years ago. I would like to see Django officially bless the idea of alternative URL systems, and provide the "full" regex system and preferably at least one "simple" system - even if all that system supports is integers and slugs. This would allow third party authors to focus on designing their "to regex" translation, rather than the details of Django's resolving.
I did some investigation into swapping at a "deeper" level, including allowing mixed includes from one resolver type to another. This is made somewhat harder by the removal of "patterns", and was much more complex. However it did give much more flexibility in allowing URL patterns which route based on other attributes than the path. I dont have any working code, it was very conceptual. I think we should at least consider a more dramatic approach in a DEP, even if it is not the intended course. Marc On 15 Sep 2016 9:52 a.m., "Sjoerd Job Postmus" <sjoerd...@sjec.nl> wrote: > > > On Thursday, September 15, 2016 at 10:38:09 AM UTC+2, Michal Petrucha > wrote: >> >> >> As cool as this idea sounds, I really don't think the URL dispatcher >> is a correct component to make database queries. FWIW, I've seen >> similar magic implemented in view decorators, and the thing I remember >> the most from this experience was that it made it a lot harder to >> follow what was happening where. >> >> Moreover, I can imagine this turning into a complicated mess of a >> syntax to allow query customizations using a weird DSL really quickly. >> After all, if we allow PK lookups, it's not that unreasonable to also >> want to be able to lookup by other keys, and it all goes downhill from >> here. >> >> Cheers, >> >> Michal >> > > > Agreed. It all goes downhill from there, so let's at least not do database > queries. > > To me, that settles it: no typecasting. > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-developers/d9db908b-d22b-428f-908a- > ecdc34b8fbfb%40googlegroups.com > <https://groups.google.com/d/msgid/django-developers/d9db908b-d22b-428f-908a-ecdc34b8fbfb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMwjO1HjuF8_c-sZef4oByK%3DrZKz4aWTPp1OvSS%3DGGRaqGOfQA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.