[Zope] Passing an instance in a form to a product method
Andreas Jung
lists at zopyx.com
Fri Apr 4 03:23:06 EDT 2008
--On 4. April 2008 09:05:59 +0200 Ulla Theiss <u.theiss at eurodata.de> wrote:
>
> Hello List,
>
> I have to pass an instance of a self-defined class within a form to a
> product method.
> I try it in the following way:
>
> <form action="addUploadFile" enctype="multipart/form-data" target="main"
> method=post>
> <input name="doc:instance" value="<dtml-var doc>" type="hidden">
^^^^^^^^^^^^
Please don't invent new syntax or new APIs...or don't expect that stuff
like this would work because you dream of it :-)
And of course you can not *pass* instances in some way through HTTP.
This makes totally no sense.
No idea what your intention is with your code. If you specify
'addUploadFile' then this method will be called within the context
of your current object. If you need to call the method within the context
of an other object, specify the URL of the related object within 'action'.
If you need reference another object as part of your form-data: specifiy
its *path* but passing the object directly to value=".." really makes no
sense. Obtain an object-by-path within your code using the
restrictedTraverse() API. But for uploading data to your current context
object you don't have to define something like "doc"... please refer
to the "Zope Book 2.7 edition" - appearently you have a basic
misunderstanding how Zope works here.
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20080404/098ba365/attachment.bin
More information about the Zope
mailing list