[ZPT] absolute url of a page template
Chris Withers
chrisw@nipltd.com
Mon, 21 Oct 2002 13:56:19 +0100
Shane Hathaway wrote:
>> absolute_url has a meaning for "objects", not "methods". And the
>> PageTemplateFile you're using definitely looks like a method (that is, a
>> View in Z3 terms).
>
> You're right, but methods in Zope have URLs too. :-) Notice the
> trailing slash... the problem is that the absolute_url() method thinks
> the PageTemplateFile has an empty string for an ID. There is a
> collector issue for it.
http://collector.zope.org/Zope/620
My workaround is to do something icky in the class:
# Templates
security.declareProtected(permissions.use,'issues')
issues = PageTemplateFile('templates/issues',globals())
issues.id='issues' # *sigh*
cheers,
Chris