[ZPT] ZPT for manage_addForm

Michael R. Bernstein mbernstein@codeit.com
27 Feb 2002 11:53:11 -0800


On Wed, 2002-02-27 at 11:13, Evan Simpson wrote:
> Michael R. Bernstein wrote:
> > Steve Alexander (on #zope) asked what ZPTs used as their add form, and I
> > found the following in ZopePageTemplate.py:
> > 
> > # Product registration and Add support
> > manage_addPageTemplateForm = PageTemplateFile(
> >     'www/ptAdd', globals(), __name__='manage_addPageTemplateForm')
> > 
> > Adding the __name__='manage_addForm' parameter to the code in my product
> > makes it work.
> 
> It's a bug.  PageTemplateFiles in Zope 2.5 didn't try to derive an 
> __name__ from the filename if one wasn't explicitly specified.  This is 
> now fixed in CVS.

Hmm. It derives it from the filename, rather than from the assignment?

That's a little counter-intuitive (but presumably consistent with
DTMLFile).

Does this mean that /PageTemplates needs another unit test?

Michael.
-- 
---------------------------------------------------
| Michael Bernstein   http://michaelbernstein.com |
|                                                 |
| CodeIt Computing    http://codeit.com           |
---------------------------------------------------