Hi,

On Thu, Mar 02, 2006 at 09:03:25AM +0000, Reinhold Strobl wrote:
> Hi, 
> 
> i am searching for a possibility to create and remove content objects in 
> Python
> Code. 
> Thanks for replies,

[EMAIL PROTECTED] > bin/zopectl debug # creating folder...
>>> root=debugger.root()
>>> from zope.app.folder.folder import Folder
>>> root['mytestfolder']=Folder()
>>> import transaction
>>> transaction.commit()
>>> ^D
[EMAIL PROTECTED] > bin/zopectl debug # removing folder...
>>> root=debugger.root()
>>> from zope.app.folder.folder import Folder
>>> root.__delitem__('mytestfolder')
>>> import transaction
>>> transaction.commit()

This is how to do it from a shell. Just use self.context['folder']=Folder()
if you are e.g. in a view.

Regards,

Frank
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to