[Zope] Adding an object programmatically

Kevin Dangoor kid@kendermedia.com
Thu, 30 Dec 1999 10:16:06 -0500


----- Original Message -----
From: Robert Wittams
To: Kevin Dangoor
Cc: Robert Wittams ; zope@zope.org
Sent: Thursday, December 30, 1999 4:54 AM
Subject: Re: [Zope] Adding an object programmatically


>><dtml-call "manage_addDTMLMethod('id', 'title', 'contents')">

>This worked perfectly :) Thanks.

>Where exactly did you find out this kind of thing? Just the source?

I think I had originally found it in the old help system that used to exist.
(This is apparently in the process of being reborn as something better). The
source would certainly have the answer. Another place to look would be to do
a View Source on the management page... by looking at what the management
interface does to add an object, you can copy that logic to add objects via
DTML.


>>> 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 *any* lists
or
>>>dictionaries. Is this to preserve persistance or something else?

>>I believe it is a security thing, but I really don't know what behavior it
>>protects us from... Personally, I'd love to be able to do lists and
>>dictionaries in PythonMethods...

>I  hope that python methods eventually expose all of the dtml functionality
>along with the ease of python... with no restrictions on data types , just
on imports...

Actually, I think PythonMethods have the same restrictions as DTML. DTML
does not let you assign to list and dictionary elements either...

Kevin