[Zope] product development help and tips

Casey Duncan casey@zope.com
Wed, 26 Mar 2003 09:38:28 -0500


The general rhythm is as follows (in product module code):

class MyClass(SimpleItem, ...):
    ...

def addMyClass(container, id, ...other form fields..., RESPONSE=3DNone):
    obj =3D MyClass(id, ...)
    container._setObject(id, obj)
    if RESPONSE is not None:
        RESPONSE.redirect(container.absolute_url() + '/manage_main')

addMyClassForm =3D PageTemplateFile(
    package_home(globals()) + '/www/addMyClassForm.pt')

The key is the _setObject(id, obj) call. That puts the object in the fold=
er. I=20
would recommend looking at the Boring product as an example to.

hth,

-Casey


On Tuesday 25 March 2003 03:06 pm, Patel, Tejash wrote:
> Hello,
>=20
> I m developing a product that will do the following:
>  My form has the following: ID, TITLE, FILE fields to fill out.
> After I have filled out the field, I click submit, I want to create a f=
older
> with the file I uploaded within the folder.
> My folder name will be the id, and the file id will be the file name.=20
>=20
> Currently, I am able to use my product to create a folder and a file, b=
ut I
> don't know now how to put the file within the folder.
>=20
> Help and tips would be greatly appreciated.
>=20
>=20
> Thanks
>=20
>=20
>=20