Well, if you just want to avoid listing the variables up front,
there's always the hideous way:

## python
name = "Guido"
print render.mypage(locals())

## template
$def with (everything)
<p>In your ear, $everything["name"] !</p>

Clearly that doesn't save any typing, though, and it masks what you're
trying to do with the template.

If you're really looking for some excitement, you could even unpack
locals() during the function call:

## python
myname="Guido"; title="BDFL"
print render.mypage(**locals())

## template
$def with (myname, title, builtins_, file_, name_, doc_)
...

Since the ordering of elements unpacked from locals() is arbitrary,
debugging this could get absolutely fascinating. (Similar productivity
enhancements can be found at http://entrian.com/goto/.)


On Apr 9, 6:10 pm, "paul jobs" <[EMAIL PROTECTED]> wrote:
> A template begins with a line like this:
>
> $def with (name, title, company='BigCo')
>
> which declares that the template takes those arguments. (The with keyword is
> special, like def or if.)
>
> Can we skip
>
> $def with (name, title, company='BigCo')
>
> and pass all local variables to the template
> thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" 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/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to