[Zope-CMF] Constructing portal folder based ZClass
programmatically
Antwan Reijnen
twanus@xs4all.nl
Thu, 09 May 2002 13:46:29 +0200
Hi Dieter,
Great! I examined the sourcecode, and now understand quite a bit more. I added id to the REQUEST, and everything works fine now!
The reason I did'nt understand this behaviour was because I used the script for quite a while already, successfully from within the portal content-add interfaces. Via invokeFactory, however, there is no id in the REQUEST however.
Ok, clear now. I added a relevant piece of comment to the ZClass based FAQ Content Type how-to on the CMF dogbowl:
http://cmf.zope.org/Members/tseaver/how_tos/faq_howto/talkback/1020943226
Thanks a lot Dieter, you helped me again!
Greetings, Antwan.
> > Traceback (innermost last):
> > ...
> > File Script (Python), line 4, in CMFQCVFolder_add
> > File C:\Program Files\Zope\lib\python\ZClasses\ZClass.py, line 524, in createInObjectManager
> > (Object: CMFQCVFolder)
> > File C:\Program Files\Zope\lib\python\ZPublisher\mapply.py, line 155, in mapply
> > (Object: CMFQCVFolder)
> > File C:\Program Files\Zope\lib\python\ZPublisher\mapply.py, line 93, in default_missing_name
> > TypeError: (see above)
>The traceback tells you:
>
> Your "CMFQCVFolder_add" is called.
>
> In line 4, it calls "createInObjectManager".
>
> A look at its source ("ZClasses/ZClass.py" line 524) reveals, that
> it calls "mapply(self._zclass_,(),REQUEST)".
>
> The error tells, "id" is missing.
>
> "REQUEST" is the second argument passed to "createInObjectManager".
>
> This second argument (i.e. "REQUEST") lacks an "id" key.
>
> Up to you to find out, why...
>
>
>
>Dieter
>
>
>_______________________________________________
>Zope-CMF maillist - Zope-CMF@zope.org
>http://lists.zope.org/mailman/listinfo/zope-cmf
>
>See http://www.zope.org/Products/PTK/Tracker for bug reports and feature requests