[Zope] Adding a document using a form

Michel Pelletier michel@digicool.com
Mon, 29 Nov 1999 13:47:00 -0500


> -----Original Message-----
> From: Mats Myrberg [mailto:mats@bigbig.to]
> Sent: Monday, November 29, 1999 12:32 PM
> To: zope@zope.org
> Subject: RE: [Zope] Adding a document using a form
> 
> 
> Hi,
> 
> I am a complete Zope newbie so have some patience with me.  
> Mike suggested a
> way to Lalo to move the code that creates the DTML Document 
> into a DTML
> Method.  I tried this method but I get the below error and 
> stack trace.  It
> seems that the call to self._setObject is failing.  What is 
> self in this
> case?  BTW the add form is living in a folder called Products 
> in the root
> folder.  My code for the DTML Method is:
> 
> <dtml-call 
> "Products.manage_addProduct['OFSP'].addDTMLDocument(id, title)">

<tested>
  <dtml-call "manage_addDTMLDocument('bob', 'is my uncle')">
</tested>

Creates a document called bob with the title 'is my uncle'.
Theoretically, the same should work dandy with just addDTMLDocument, but
it doesn't.  I'll put that in the collector if it's a bug... You can
change the objects content through 'manage_edit'.

-Michel