[ZPT] How to getId() of pt from a Script (Python)

José Henrique jhreis at gmail.com
Tue Oct 4 12:29:32 EDT 2005


Use "print template.getId()".

2005/10/4, Chris Miles <miles.chris at gmail.com>:
> I have a Page Template in a folder: folder1/mypage.pt
> containing:
>   <span tal:replace="here/myscript">Testing</span>
>
> myscript is a Script (Python) containing:
>   print context.getId()
>   return printed
>
> Now, when folder1/mypage.pt is called TTW, it displays "folder1" as the
> context.getId(), but I was expecting (and hoping) it would display
> "mypage.pt"...  Isn't it being called within the "context" of mypage.pt
> ?
>
> How do I get the Script (Python) to fetch the id of the Page Template
> it was called from?
>
> (Zope 2.8.1)
>
> Cheers,
> Chris
>
> --
> http://chrismiles.info/
>
>
> _______________________________________________
> ZPT mailing list
> ZPT at zope.org
> http://mail.zope.org/mailman/listinfo/zpt
>


More information about the ZPT mailing list