[Zope-CMF] Constructing portal folder based ZClass programmatically

Antwan Reijnen antwan@dexus.nl
Tue, 07 May 2002 13:06:36 +0200


Hi all,

I use Zope 2.3.3, and CMF 1.2. 

I created a ZClass based on Portal Folder. I used two different methods in a Python Script to add an instance to a portal folder in a portal, and both failed with the same error. 

The two methods do however create other portal-content-based ZClasses instances correctly! 

The first method goes like this and as said, works correctly for my normal portalcontent based ZClasses:

myPortalFolderInWhichTheContentGoes.invokeFactory
(type_name='PortalFolderBasedZClassContentType', id='my_folder_based_content')

It complains:

Error Type: TypeError
Error Value: argument id was ommitted

The second method, which also works correctly for normal portalcontent based ZClasses, goes like this:

context.portal_types.constructContent(type_name='PortalFolderBasedZClassContentType', container=myPortalFolderInWhichTheContentGoes, id='my_folder_based_content')

It also complains:

Error Type: TypeError
Error Value: argument id was ommitted

It seems that the id-parameter is swallowed somewhere in the proces. Anyone who experienced the same problems?

I hereby attatch the traceback for more clues.
  
Any clues will be appreciated.

TIA, Antwan.



Antwan Reijnen

DEXUS New Media
Metropole Office 
Laan van Meerdervoort 70 
2517 AN Den Haag
Tel 070-3114800 
Fax 070-3656279 
http://www.dexus.nl

DEXUS New Media maakt deel uit van de Metropole IT Group 
http://www.metropole-it.nl 

ICQ#: 7916222