Re: making URL resolving/reversing gradually more flexible

2010-11-13 Thread Gabriel Hurley
> I'm not sure how open the core devs > are to non-core devs poking around in core parts of the framework > though. Anyone and everyone is welcome to write patches for any part of the framework! There's no sacred portion that only a core dev can touch. It sounds like you've given thought to the im

Re: making URL resolving/reversing gradually more flexible

2010-11-12 Thread Sam Lai
On 12 November 2010 23:14, burc...@gmail.com wrote: > First I thought you're going to return some instance with reverse > which has get_possibilities. > And you just want RegexURLPattern to register 3 usual regexes for you > instead of one. Effectively. I should've been more concise when writing

Re: making URL resolving/reversing gradually more flexible

2010-11-12 Thread burc...@gmail.com
Hi Sam, On Fri, Nov 12, 2010 at 2:45 PM, Sam Lai wrote: > On 12 November 2010 19:14, burc...@gmail.com wrote: >> Ah, sorry, tl;dr happened to me in previous message. >> >> I used to do the following: >> >> alternatives = {'html': '/', 'xml': '.xml', 'json': '.json'} >> for name, alt in alternati

Re: making URL resolving/reversing gradually more flexible

2010-11-12 Thread Sam Lai
On 12 November 2010 19:14, burc...@gmail.com wrote: > Ah, sorry, tl;dr happened to me in previous message. > > I used to do the following: > > alternatives = {'html': '/', 'xml': '.xml', 'json': '.json'} > for name, alt in alternatives.iteritems(): >    urlpatterns += ('^newitems'+alt+'$', 'views.

Re: making URL resolving/reversing gradually more flexible

2010-11-12 Thread burc...@gmail.com
Ah, sorry, tl;dr happened to me in previous message. I used to do the following: alternatives = {'html': '/', 'xml': '.xml', 'json': '.json'} for name, alt in alternatives.iteritems(): urlpatterns += ('^newitems'+alt+'$', 'views.newitems', {'format': name}, 'newitems-'+name) You can make you

Re: making URL resolving/reversing gradually more flexible

2010-11-11 Thread burc...@gmail.com
Hi Sam, what's the problem with regexp = '^newitems'+SUFFIX+'$' where SUFFIX='(/|\.xml|\.json)' ? And if you need more shortcuts, there are surlex ( http://codysoyland.com/2009/sep/6/introduction-surlex/ ) and alternatives. On Fri, Nov 12, 2010 at 11:25 AM, Sam Lai wrote: > [First timer partici