Mike Orr wrote:
> On Dec 19, 2007 8:37 AM, Ian Bicking <[EMAIL PROTECTED]> wrote:
>
>> pylons.c is just a little odd -- if we could change the render function
>> to just take substitution variables as keyword arguments then I
>> personally would just stop using pylons.c, and probably be happier for
>> it. Right now I guess I have to do variables=dict(...), which isn't
>> horrible but doesn't look pretty for such a common construct.
>
> If you really really want **variables, we can do that. But that will
> prevent us from passing arbitrary rendering args to the underlying
> engine. Also, it would make render() have a substantially different
> signature from Renderer.render(). Unless you're changing your mind
> about that too.
Maybe, I don't know. I'm still not sure render() should be called
externally at all. I kind of like the idea of creating template objects
that are similar to string.Template, i.e.:
tmpl = my_loader('template_name', renderer)
return tmpl.substitute(**kw)
And then render() would just combine both those functions in a simple
way; you'd bind the renderer up-front, then pass in both template name
and **kw at the same time. We could allow for arbitrary arguments to be
passed at load-time, though that complicates combining those two into a
single function. But we could also just reserve one argument like
template_config=dict(), and pass that value to the renderer, and every
other keyword argument as variables.
--
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-devel" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-devel?hl=en
-~----------~----~----~----~------~----~------~--~---