[Repoze-dev] url dispatch, args, matchdicts
Hi bfg folks, one feature I miss from pylons is having elements from the route parsing be automatically passed to controller methods as named args. I expect this got some thought and was decided against, I'm curious why? It seems to me it would be nice if this route: route path=/foo/bar/:baz name=foo view=.views.foo_view view_attr=bar / would automatically pass baz in, bypassing the need to look in reques.matchdict if foo_view had a method like: def bar(self, baz): Thoughts? thanks iain ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] url dispatch, args, matchdicts
Iain Duncan wrote: Hi bfg folks, one feature I miss from pylons is having elements from the route parsing be automatically passed to controller methods as named args. I expect this got some thought and was decided against, I'm curious why? It seems to me it would be nice if this route: route path=/foo/bar/:baz name=foo view=.views.foo_view view_attr=bar / would automatically pass baz in, bypassing the need to look in reques.matchdict if foo_view had a method like: def bar(self, baz): Thoughts? I doubt we will add that as the default behavior -- we are hoping to keep the calling convention completely uniform by default. However, it should be trivial to write a decorator which you can use to adapt the two. Hmm, what about adding another optional param to route tags? something like use_global_views, but as a flag for the passing in named args automatically? I would think a lot of people coming to bfg from other frameworks and using it as a micro-framework would really like that. Or am I the only one? ;-) iain ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] url dispatch, args, matchdicts
On 2010-6-2 21:48, Iain Duncan wrote: Hmm, what about adding another optional param to route tags? something like use_global_views, but as a flag for the passing in named args automatically? I would think a lot of people coming to bfg from other frameworks and using it as a micro-framework would really like that. Or am I the only one? ;-) I suspect you are :). I came from Pylons and have not missed that feature in BFG. Wichert. -- Wichert Akkerman wich...@wiggy.net It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] url dispatch, args, matchdicts
Hmm, what about adding another optional param to route tags? something like use_global_views, but as a flag for the passing in named args automatically? I would think a lot of people coming to bfg from other frameworks and using it as a micro-framework would really like that. Or am I the only one? ;-) Pylons is actually supposed to be moving to the consensus (request-only) calling convention. Ok, well I'm all for inter-framework interoperability and code sharing so nix that then, request it is. =) Thanks for pointing that out. Iain ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev