Rob Hudson wrote:
> * Defaulting to "[-\w+]" makes sense to me as a default regular
> expression to catch most URL patterns.  It can catch strings, slugs,
> and numbers.  Things like this would still work: "/{{ year }}/{{ month
> }}/{{ day }}/{{ slug }}/" but may not be as optimized as specifically
> looking for digits or [a-z].

Here you loose a nice feature of not allowing broken URLs. If I expect 
only digits here:

     url(r'^things/(\d+)/$', myview),

currently I don't have to make additional tests in view code to be sure 
that int(id) won't break. It won't even reach my view quickly bouncing 
with 404 response.

I can't think right now of a "typing" scheme for URL fragments that 
doesn't add mess though... Perhaps some seriously magical naming 
convention would do. Like everything that ends with "id", "year", 
"month", "day" is a \d+.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to