[Zope] Zope pdf's on the fly

Dennis Allison allison@sumeru.stanford.EDU
Mon, 7 Jul 2003 10:57:22 -0700 (PDT)


Thanks.  I'd surpressed that idiom :-) but I think it'll do the job.
	-d

On Mon, 7 Jul 2003, J Cameron Cooper wrote:

> >
> >
> >If I use a form to set up parameters to the external method and 
> >
> >	<form action="doit.pdf()">
> >	..
> >	</form>
> >
> >it works fine.  Of course, 
> >
> >	<dtml-var expr="doit.pdf()">
> >
> >doesn't.
> >  
> >
> One of the problems that let to the "path syntax" of TALES. As such, 
> this is one of the old, bad, Zopisms I'm about to explain.
> 
> If you want to call something with dots in it in Python syntax, you have 
> to look it up in the namespace dictionary. The namespace dictionary is 
> mysteriously named '_'. No, that's not a crappy emoticon, it's an 
> underscore, in quotes (which is the STX code markup.) And you have to 
> use strings to look up a name in a dictionary. So the lookup looks like::
> 
> _['nameofthing']
> 
> Also available is 'getitem' on the namespace variable, if that seems 
> less insane::
> 
> _.getitem('nomeofthing')
> 
> So your code, in DTML, will look like::
> 
> <dtml-var expr="_['doit.pdf']">
> 
>           --jcc
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>