On 11/11/10 12:38 , Wichert Akkerman wrote:
On 11/11/10 12:05 , Mike Orr wrote:
Since HTML is all about hyperlinks, it makes sense to give them
special treatment, especially if you're trying to encourage people to
always use URL generation rather than literal URLs for internal links,
as Pylons does.

Stick a py:with="u=request.route_url" at the top of you template if you
want brevity?

My standard pattern is to expose a 'tools' object to templates which has
a number of functions such as route_url, model_url, etc. for use in
templates. I've never felt that having to spell <a
href="${tools.route_url('personal+settings')}">..</a> is too long or
awkward.

Relatedly: there are two completely different ways to generate a URL: model based and route based. Your suggestion to use 'url' or 'u' would imply a document preference for one of the two, which I do not feel is warranted. As Chris said earlier in this thread both are just as useful and important.

Wichert.

--
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to