A couple of lines at the bottom show one way to create a folder and an object inside that folder...

Anthu Nguyen wrote:
Hi,

I've tried everything I can think of and am probably missing something
obvious - help...

I'm trying to (1) Create a folder, then (2) Add a new zclass inside that
folder.
Instead, the zclass is being added in the same space as the folder:

- What I want:

New Folder
    New ZClass

- What's happening:

New Folder
New ZClass

===========
The code that doesn't work:

request = context.REQUEST
pbuildid = request.pbuildid

# Add a new folder with id=pbuildid
context.manage_addFolder(id=pbuildid)

# Add a new instance of the ZClass inside new folder
instance = context.pbuild.createInObjectManager(request['id'], request)
instance.propertysheets.pbuild_properties.manage_editProperties(request)

context.manage_addProduct['OFSP'].manage_addFolder(REQUEST.Filename, REQUEST.Title)


# create an index_html DTML document
context[REQUEST.Filename].manage_addProduct['OFSP'].manage_addDTMLMethod('index_html',
title="", file="Initial content")

HTH

Cliff
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to