[Zope] create objects with dot in product

Tim tim@xxvii.net
Tue, 25 Feb 2003 01:29:39 -0500


Peter wrote on Monday, February 24, 2003, 5:48:53 PM:
>>There must be a trick, since the ZMI can do it?

> class MyProduct:
>          ...
>          file_htm = PageTemplateFile('www/file.htm', globals())

> MyProduct.__dict__['file.htm'] = MyProduct.file_htm

This worked, thanks.

Chris's (whom i also thank for his response) setattr(self, ...)
solution didn't work, because there is no "self" available at that
point in the object. Probably would work if it was inside a method.

-- 
Tim Middleton | Cain Gang Ltd | Asios pummeled his thighs..."Father Zeus,
x@veX.net     | www.Vex.Net   | you, even you, turn out to be a liar." (H)