[Zope] adding files and folder in a object during generation

2007-03-14 Thread Allen Huang
I created an external product using python to creates a folderish object. 
During object instantiation by 
manage_addProduct(self, id, ..): 
I wish to add a couple of empty files and folder. 
 
I tried 
self.manage_addFolder('folderID', , 'folderName') 
but it just create a folder outside of the object.
I tried
id.manage_addFolder('folderID', , 'folderName') 
but id is a str and does not have manage_addFolder
I tried 
self.getitem(id).manage_addFolder('folderID', , 'folderName')
_.getitem(id) is a method I frequently used in DTML but it didn't work in 
python.
 
what expression do I use to replace with self so ZOPE will create folders and 
files in the newly generated object?


 

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/___
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 )


Re: [Zope] adding files and folder in a object during generation

2007-03-14 Thread Andreas Jung



--On 14. März 2007 22:18:06 -0700 Allen Huang <[EMAIL PROTECTED]> wrote:


I created an external product using python to creates a folderish object.
During object instantiation by  manage_addProduct(self, id,
..):
I wish to add a couple of empty files and folder.


Such tasks belong into manage_afterAdd() or should be implemented using the 
lately introduced event-based notification mechanism.


-aj

pgpFlDoi3KbVJ.pgp
Description: PGP signature
___
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 )


Re: [Zope] adding files and folder in a object during generation

2007-03-14 Thread Allen Huang
Could anyone give me any examples?


- Original Message 
From: Andreas Jung <[EMAIL PROTECTED]>
To: Allen Huang <[EMAIL PROTECTED]>; Zope 
Sent: Thursday, March 15, 2007 1:23:14 PM
Subject: Re: [Zope] adding files and folder in a object during generation


--On 14. März 2007 22:18:06 -0700 Allen Huang <[EMAIL PROTECTED]> wrote:

> I created an external product using python to creates a folderish object.
> During object instantiation by  manage_addProduct(self, id,
> ..):
> I wish to add a couple of empty files and folder.

Such tasks belong into manage_afterAdd() or should be implemented using the 
lately introduced event-based notification mechanism.

-aj


 

TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/___
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 )


Re: [Zope] adding files and folder in a object during generation

2007-03-14 Thread Andreas Jung



--On 14. März 2007 22:40:24 -0700 Allen Huang <[EMAIL PROTECTED]> wrote:


Could anyone give me any examples?






-aj

pgpo7WD7DCILz.pgp
Description: PGP signature
___
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 )