[Zope-CMF] constructContent ?

Florent Guillaume fg@nuxeo.com
14 Nov 2001 23:56:41 GMT


constructContent is a method internal to the portal types objects
themselves. Aren't you rather looking for invokeFactory, which is a
method of the folder ?

	container.invokeFactory('News Item', id)
	newitem = container[id]
	newitem.editMetadata(...)


Florent


Jan Torben Heuer  <Jan-T@gmx.de> wrote:
> Ok, thanks for your further help.
> 
> I read a bit around CMF and found the constructContent Method in the CMF API 
> reference.
> 
> However it doesn't seem to work. I tried to port Jeffreys construction, but 
> they didn't seem to fit.
> 
> That is what I expect to work:
> newitem=constructContent('News Item', container, id)
> 
> newitem shall be the object I created, so I could use its .editMetadata 
> method to update this.
> 
> Error Type: NameError
> Error Value: global name 'constructContent' is not defined
> 
> Maybe I need a parent for this object? But what and why? Or is this a 
> namespace problem? (whatever means namespace, bzw. why so I need that?)
> 
> Hope you can help me again.
-- 
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 10  http://nuxeo.com  mailto:fg@nuxeo.com