[Zope-CMF] non string arguments to python scripts

Lucas Hofman lucas.hofman@pgs.com
Wed, 28 May 2003 15:02:09 +0200


The script below is called from a form. pictureFile is of type file. 
However, after passing the parameter to another python script 
(insert_picture) it has become a string (I concluded this because 
same_type(pictureFile, '') returns true. The value is the filename of 
the file object..

Is there a way to pass the pictureFile parameters so that it is not 
converted?


## Script (Python) "agenda_edit"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=title, choice, text, description, project, consortium, 
notOnMainPage, pictureId, pictureCaption, pictureFile
##title=
##
from string import strip
if strip(choice) == 'Insert Image':
     return context.insert_picture (text, pictureId, pictureCaption, 
pictureFile)


I feel that I am overlooking something...

-- 
Hilsen/Regards,

Lucas Hofman
PGS Research                                    work: +47 67514059
PO Box 354                                       fax: +47 67526640
N-1326 Lysaker, Norway                        mobile: +47 91601305
lucas.hofman@pgs.com                            http://www.pgs.com