[Zope] [Plone-Users] script calling template

Andreas Jung lists at zopyx.com
Thu Sep 11 01:24:48 EDT 2008



--On 10. September 2008 19:57:29 -0700 David Bear <David.Bear at asu.edu> 
wrote:

> I have a script that calls a template.
>
> The template has a tal expressions like this
>
> <p tal:content="structure here/ploneDoc/getText"> </p>
>
> I want my script to call the template in such a way that the string
> 'ploneDoc' is replaced by a different string.
>
>

The well-known techniques for obtaining a object through acquisition

   obj = getattr(context, object_id)

or path traversal

   obj = context.restrictedTraverse('/path/to/obj')

also works here.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20080911/e0877283/attachment.bin 


More information about the Zope mailing list