Re: Easier URL patterns

2008-04-10 Thread Fredrik Lundh
Peter Rowell wrote: > I sort of know the answers, but it would be interesting (to me at > least) to hear what the core developers think. as for most successful open source projects, the core audience is people that are pretty much like themselves. projects that try to "talk down to the masses

Re: Easier URL patterns

2008-04-09 Thread Peter Rowell
> Django is the web framework for perfectionists with deadlines! Thank you. Somehow I missed that. :-) Seriously, one of the key things you do when marketing a product is identify your target audience. Adrian and Jacob (or their editors) had to do that when writing the book. What specifically m

Re: Easier URL patterns

2008-04-09 Thread Rajeev J Sebastian
On Wed, Apr 9, 2008 at 10:02 PM, Peter Rowell <[EMAIL PROTECTED]> wrote: > threshold they must/should clear in order to use it? I don't ask this > question sarcastically. If you were to write a 2 to 3 sentence > description of your intended developer audience, how would it read? Django is th

Re: Easier URL patterns

2008-04-09 Thread Peter Rowell
This conversation is reminiscent of many others I have seen in other technical communities through the years. I believe the need for a simpler URL pattern mechanism (and perhaps other simplifying tools) is largely dictated by the stated target audience for Django. If Django is meant for experienc

Re: Easier URL patterns

2008-04-09 Thread AmanKow
On Apr 8, 12:20 pm, Trevor Caira <[EMAIL PROTECTED]> wrote: > You don't need anything more than python string formatting for that. > e.g. > > slug_re = r'(?[-\w]+)' > year_re = r'(?\d{4})' > # snip > url(r'/article/%s/' % slug_re, views.article_detail), > url(r'/category/%s/' % slug_re, vi

Re: Easier URL patterns

2008-04-09 Thread Rajeev J Sebastian
On Wed, Apr 9, 2008 at 5:39 AM, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > I thought I'd mention Kodos as a help for people with regex troubles: > > http://kodos.sourceforge.net/ > > When I've wondered why things just weren't working in my URLs, and I've > wasted time banging on stuff, copying the

Re: Easier URL patterns

2008-04-08 Thread Todd O'Bryan
I thought I'd mention Kodos as a help for people with regex troubles: http://kodos.sourceforge.net/ When I've wondered why things just weren't working in my URLs, and I've wasted time banging on stuff, copying the pattern into Kodos and typing in the URL I wanted to match it has usually pointed o

Re: Easier URL patterns

2008-04-08 Thread Rock
On Apr 8, 12:55 pm, Derek Anderson <[EMAIL PROTECTED]> wrote: > to reuse a well-known axiom: "those who don't know regular expressions > are doomed to reinvent them... poorly" > That saying can be countered by this old saw which I find amusing: "A programmer has a problem to solve and decides to

Re: Easier URL patterns

2008-04-08 Thread Derek Anderson
i *would* like to champion this, as django's regex -> function mapping is its best single feature, IMO. to reuse a well-known axiom: "those who don't know regular expressions are doomed to reinvent them... poorly" derek Rob Hudson wrote: > Just a note: I'm not going to champion this one sinc

Re: Easier URL patterns

2008-04-08 Thread Trevor Caira
On Apr 8, 12:14 pm, AmanKow <[EMAIL PROTECTED]> wrote: > I don't know about sticking that in core, but that sure is a neat idea > that I think I might use in some personal stuff. Particularly useful > when urls have a complex 'bases' that I wish to use to parse the same > info out of groups of ur

Re: Easier URL patterns

2008-04-08 Thread AmanKow
I don't know about sticking that in core, but that sure is a neat idea that I think I might use in some personal stuff. Particularly useful when urls have a complex 'bases' that I wish to use to parse the same info out of groups of urls each time that are distinguished with additional fiddly bits

Re: Easier URL patterns

2008-04-08 Thread Rob Hudson
Just a note: I'm not going to champion this one since I do know regular expressions. I simply read elsewhere that it is a common stumbling block for newbies and thought I'd bring it up. Actually, the regex newbies I know usually just need a few examples to get them off the ground. E.g. use "[-\

Re: Easier URL patterns

2008-04-08 Thread Marc Fargas
> El mar, 08-04-2008 a las 04:27 -0500, James Bennett escribió: > Or people could go learn from one of the many thousands of regex > tutorials that's already been written? There's a point at which we > have to assume that people are willing to help themselves out a bit by > learning Python and im

Re: Easier URL patterns

2008-04-08 Thread James Bennett
On Tue, Apr 8, 2008 at 4:10 AM, Marc Fargas <[EMAIL PROTECTED]> wrote: > Maybe the documentation refactoring could include an Appendix: > "Introduction to REGEX" and "The regular expressions you'll find > everyday" or something like that. > > With this, newcomers would have an introduct

Re: Easier URL patterns

2008-04-08 Thread Marc Fargas
El mar, 08-04-2008 a las 10:09 +0200, David Larlet escribió: > >>url(r'^(?P[-\w]+)/$', myview), > > > > Note that this example is more complicated than it needs to be. I'd > > write it like this: > > > >(r'^([-\w]+)/$', myview) > In this case, what about a default dictionary of popular reg

Re: Easier URL patterns

2008-04-08 Thread David Larlet
Le 8 avr. 08 à 08:25, Adrian Holovaty a écrit : > > On Mon, Apr 7, 2008 at 3:49 PM, Rob Hudson <[EMAIL PROTECTED]> > wrote: >> would be much less daunting to those that haven't read the Friedl >> book >> than this: >> >>url(r'^(?P[-\w]+)/$', myview), > > Note that this example is more com

Re: Easier URL patterns

2008-04-07 Thread Adrian Holovaty
On Mon, Apr 7, 2008 at 3:49 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > would be much less daunting to those that haven't read the Friedl book > than this: > > url(r'^(?P[-\w]+)/$', myview), Note that this example is more complicated than it needs to be. I'd write it like this: (r'^([-

Re: Easier URL patterns

2008-04-07 Thread James Bennett
On Mon, Apr 7, 2008 at 3:49 PM, Rob Hudson <[EMAIL PROTECTED]> wrote: > It was discussed previously that making URL matching easier by not > having to understand regular expressions would be a nice goal, and > perhaps a nice 1.0 goal... Two things: 1. If Django were going to support an altern

Re: Easier URL patterns

2008-04-07 Thread Ivan Sagalaev
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 specificall

Easier URL patterns

2008-04-07 Thread Rob Hudson
It was discussed previously that making URL matching easier by not having to understand regular expressions would be a nice goal, and perhaps a nice 1.0 goal... http://groups.google.com/group/django-developers/browse_thread/thread/b4c237ad76f9eeca/b9b2acc81fe6e5cf I just stumbled across yet anoth