On 15/09/16 16:37, Curtis Maloney wrote:
Somewhere I have code to provide a "parse" based URL router.

Will dig it up now 1.10 has has shipped

Ah, found it...

So, here is a gist of a sample of using parse (https://pypi.org/project/parse/) instead of regex.

https://gist.github.com/funkybob/3d90c57a837bc164d8b402a1c5b95a8b

Since you can register extra type names, and those types can cast also, it covers a lot of things some people expect [but don't get] from regex.


--
C



On 14 September 2016 6:38:20 PM AEST, Florian Apolloner
<f.apollo...@gmail.com> wrote:

    Hi Emil,

    On Tuesday, September 13, 2016 at 9:50:22 PM UTC+2, Emil Stenström
    wrote:

        and more experienced users are expected to switch over to using
        regexes directly to get the exact behavior they want.


    How so? Personally I would use this quite quickly since a few
    builtin types would cover 99%. While I can write regex in sleep
    nowadays, I still find it kinda tedious to redefine what "slug"
    means in every URL I wanna match something… I am sure others think
    the same.


        Beginners likely won't look at all the different options and
        choose one based on it's merits, they'll pick whatever their
        teacher suggests they use. Also installing an extra package when
        setting up django feels a bit strange.


    I think the eco system is far enough to support that, after all
    south lived long and well as external package. Either way, DEP or
    not, having an implementation out there would definitely help.

    Cheers,
    Florian


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

--
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
<mailto:django-developers+unsubscr...@googlegroups.com>.
To post to this group, send email to django-developers@googlegroups.com
<mailto: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/B35D1655-D658-41FC-9EB5-83311B6C892C%40tinbrain.net
<https://groups.google.com/d/msgid/django-developers/B35D1655-D658-41FC-9EB5-83311B6C892C%40tinbrain.net?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/9ab6342b-f969-4a3b-1263-aabd27cc0eb9%40tinbrain.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to