Re: URL confs should take callables as well as strings

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 08:24 -0500, Jeremy Dunck wrote: > On 8/11/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Fri, 2006-08-11 at 11:52 +, Michele Cella wrote: > > > Adrian Holovaty wrote: > > > I'm not actually using django (yet) but I always wondered why you > > > weren't using ca

Re: URL confs should take callables as well as strings

2006-08-11 Thread Jeremy Dunck
On 8/11/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2006-08-11 at 11:52 +, Michele Cella wrote: > > Adrian Holovaty wrote: > > I'm not actually using django (yet) but I always wondered why you > > weren't using callables directly, it's really more intuitive and > > pythonic, wh

Re: URL confs should take callables as well as strings

2006-08-11 Thread Malcolm Tredinnick
On Fri, 2006-08-11 at 11:52 +, Michele Cella wrote: > Adrian Holovaty wrote: > > > > I must say, I'm really excited about this change. I've been converting > > my own stuff to it, and it feels more natural. > > > > I'm not actually using django (yet) but I always wondered why you > weren't us

Re: URL confs should take callables as well as strings

2006-08-11 Thread Michele Cella
Adrian Holovaty wrote: > > I must say, I'm really excited about this change. I've been converting > my own stuff to it, and it feels more natural. > I'm not actually using django (yet) but I always wondered why you weren't using callables directly, it's really more intuitive and pythonic, what ab

Re: URL confs should take callables as well as strings

2006-08-11 Thread Adrian Holovaty
On 6/26/06, Simon Willison <[EMAIL PROTECTED]> wrote: > I've been playing around with making the URL resolver accept a > callable in addition to accepting 'module.blah' strings, and I think > it's a big improvement. OK, we've gained this functionality as of http://code.djangoproject.com/changeset

Re: URL confs should take callables as well as strings

2006-06-26 Thread Simon Willison
On 26 Jun 2006, at 11:51, Daniel Poelzleithner wrote: > What i still missing is a possibility to use other values to find the > right view (most likely the http host header). > I suggested http://code.djangoproject.com/ticket/1192 but Adrian > doesn't > like it for some reason I can't understa

Re: URL confs should take callables as well as strings

2006-06-26 Thread Daniel Poelzleithner
Simon Willison wrote: > Allowing callables in urlconfs opens up a whole bunch of other > opportunities as well. Setting up generic views could be made much > less fiddly: What i still missing is a possibility to use other values to find the right view (most likely the http host header). I su

Re: URL confs should take callables as well as strings

2006-06-26 Thread Vladimir Pouzanov
+1 for the patch. If you don't want to put logics in urls.py put it into url_logics.py and import from urls ;) The patch really makes things look better -- Sincerely, Vladimir "Farcaller" Pouzanov http://www.hackndev.com --~--~-~--~~~---~--~~ You received this m

Re: URL confs should take callables as well as strings

2006-06-26 Thread Ivan Sagalaev
Malcolm Tredinnick wrote: > Another thing we need to document better here, because this claim is not > quite correct (didn't you help write this?). The patterns() function > returns a normal Python list. So you can just append successive calls to > patterns() to each other: > > urlpattern

Re: URL confs should take callables as well as strings

2006-06-26 Thread Simon Willison
On 26 Jun 2006, at 11:04, Malcolm Tredinnick wrote: > Another thing we need to document better here, because this claim > is not > quite correct (didn't you help write this?). D'oh. No, the pattern prefixing stuff was nothing to do with me. Not sure how I missed that trick! Cheers, Simon

Re: URL confs should take callables as well as strings

2006-06-26 Thread Malcolm Tredinnick
On Mon, 2006-06-26 at 10:30 +0100, Simon Willison wrote: > I've been playing around with making the URL resolver accept a > callable in addition to accepting 'module.blah' strings, and I think > it's a big improvement. > > The change itself is very simple - when a URL is resolved, callable >

URL confs should take callables as well as strings

2006-06-26 Thread Simon Willison
I've been playing around with making the URL resolver accept a callable in addition to accepting 'module.blah' strings, and I think it's a big improvement. The change itself is very simple - when a URL is resolved, callable (callback) is used to decide if the callback is already a callable