[ZCM] [ZC] 620/ 2 Reject "PageTemplateFile doesn't set id"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Mon, 06 Jan 2003 10:23:54 -0500


Issue #620 Update (Reject) "PageTemplateFile doesn't set id"
 Status Rejected, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/620

==============================================================
= Reject - Entry #2 by chrisw on Jan 6, 2003 10:23 am

 Status: Pending => Rejected

The problem here is that the object doesn't know which name it should be accessed through, since that's defined by the code that instantiates the PageTemplateFile, eg:

    login_form = PageTemplateFile('templates/login_form',globals())

So, the only way I can think to 'solve' this problem is by changing the above to the (aesthetically unpleasing) code as follows:

    login_form = PageTemplateFile('templates/login_form',globals())
    login_form.id='login_form' # *sigh*

If anyone else can think of a nicer way of doing this, please re-open this issue!
________________________________________
= Request - Entry #1 by chrisw on Oct 15, 2002 10:49 am

PageTemplateFile never sets the id attribute on instantiation, so my_ptf.getId() returns and empty string.

It should returns the id that the PTF is accessible through.
==============================================================