On 11/11/10 13:48 , Chris Rossi wrote:


On Thu, Nov 11, 2010 at 6:40 AM, Wichert Akkerman <wich...@wiggy.net
<mailto:wich...@wiggy.net>> wrote:

    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.

FWIW, since we're talking about definitions that are in people's
projects (via Paster templates) and not in Pyramid itself, I feel like
the stakes are probably lower than they would seem from this discussion.
  Couldn't the routes style templates define 'url' and not the traversal
style?  Or define 'url' differently based on which style of dispatch is
being used?  There aren't any Paster templates for hybrid apps are there?

I'm afraid that will cause confusion: people will have certain expectations when they encounter a Pylons 2 app, and it will be odd if 'url' behaves differently than they expect in 50% of the applications. A related worry is add-ons that may expect 'url' to behave in a certain way and as a result only work in 50% of the Pylons 2 projects.

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