[ZPT] ZPT for manage_addForm

Michael R. Bernstein mbernstein@codeit.com
27 Feb 2002 13:30:08 -0800


On Wed, 2002-02-27 at 13:09, Evan Simpson wrote:
> R. David Murray wrote:
> > On 27 Feb 2002, Michael R. Bernstein wrote:
> >>Hmm. It derives it from the filename, rather than from the assignment?
> > 
> > I think it can't know the name of the local variable to which
> > it is being assigned.  This is a python limitation.
> 
> When you use one in a class, and don't provide an explicit __name__ 
> argument, the class initialization will assign __name__ based on the 
> attribute name.
> 
> Since constructors are not class attributes, they weren't getting a 
> __name__ unless you gave them one.

Hmm. So shouldn't it be possible for the PageTemplateFile class __init__
to assign __name__ based on the module attribute that it's being
assigned to, instead of based on the file name? This would seem to be
more consistent with the class attribute __name__ assignment.

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