[Zope] Adding an object programmatically

Robert Wittams rob@conspiracy.nu
Wed, 29 Dec 1999 15:23:03 +0000


<html><head></head>
<body>I've been using Zope for about a week now - its very cool!<br><br>I am probably just confused, so could someone put me out of my misery <br>and tell me how to add a DTML method to a ZClass in its add method. <br>The ZClass is a subclass of Object manager. <br><br><br>This seems like it should be possible from DTML... <br><br><br>First of all I tried to subclass both DTML Method and object manager, but they seem to interfere with each others manage_main methods... so I now have a child which is a DTML method. I just need to add it when the Zclass instance is added. <br><br>I tried things like this:<br><br><br>&lt;dtml-call "_.addDTMLMethod('content')" &gt; <br><br>with not much luck. <br><br><br>PS. I had a look at python methods, which seem a lot easier to use if you know python. However, I didn't seem to be able to assign to <strong class=txt_star>*any*</strong> lists or dictionaries. Is this to preserve persistance or something else? <br><br>eg to do<br>list[4] = 'help!
'<br>I do<br>list = list[:4] + ['help'] + list[5:] <br><br>is this right? <br><br>Thanks <br><br>Rob   </body>
</html>