[Zope] Unable create photo object using dtml and python

Stefan H. Holek stefan@epy.co.at
Thu, 13 Mar 2003 17:19:29 +0100


The file parameter you pass to manage_addPhoto must be a FileUpload object=20
not simply a filename.

Stefan


--On Donnerstag, 13. M=E4rz 2003 15:59 +0000 LIM TIENAIK=20
<lim_tien_aik@hotmail.com> wrote:

>
> 	I would like to ask for a little help with the photo and photo folder
> product. I have installed it on zope, but adding photo dont seems to work
> with either dtml or python. The syntax i used to add a photo is
> <dtml-call "manage_addProduct['Photo'].manage_addPhoto(name,title,
> file)"> and the syntax i used in python is
> context.manage_addProduct['Photo'].manage_addPhoto(name,title,file).
> Those 2 ways dont work and the error message from zope i receive is Error
> Type: AttributeError
> Error Value: read
> Traceback (innermost last):
>   File C:\Program Files\skyheavens\lib\python\ZPublisher\Publish.py, line
> 150, in publish_module   File C:\Program
> Files\skyheavens\lib\python\ZPublisher\Publish.py, line 114, in publish
> File C:\Program Files\skyheavens\lib\python\Zope\__init__.py, line 158,
> in zpublisher_exception_hook     (Object: skyheavens)
>   File C:\Program Files\skyheavens\lib\python\ZPublisher\Publish.py, line
> 98, in publish   File C:\Program
> Files\skyheavens\lib\python\ZPublisher\mapply.py, line 88, in mapply
> (Object: addPhotoScript)
>   File C:\Program Files\skyheavens\lib\python\ZPublisher\Publish.py, line
> 39, in call_object     (Object: addPhotoScript)
>   File C:\Program
> Files\skyheavens\lib\python\Shared\DC\Scripts\Bindings.py, line 252, in
> __call__     (Object: addPhotoScript)
>   File C:\Program
> Files\skyheavens\lib\python\Shared\DC\Scripts\Bindings.py, line 283, in
> _bindAndExec     (Object: addPhotoScript)
>   File C:\Program
> Files\skyheavens\lib\python\Products\PythonScripts\PythonScript.py, line
> 291, in _exec     (Object: addPhotoScript)
>     (Info: ({'script': <PythonScript instance at 01849B40>, 'context':
> <Folder instance at 01783810>, 'container': <Folder instance at
> 01783810>, 'traverse_subpath': []}, ('picuture', 'a new picture',
> 'C:\\WINDOWS\\Desktop\\shirt-design\\cover2.jpg'), {}, None))   File
> Script (Python), line 1, in addPhotoScript
>   File C:\Program Files\skyheavens\lib\python\Products\Photo\Photo.py,
> line 654, in manage_addPhoto AttributeError: (see above)
>
>
> I hope that someone can help me with this. Thanks
>
> _________________________________________________________________
> Are you in love? Find a date on MSN Personals http://match.msn.com.my/
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )

--
Those who write software only for pay should go hurt some other field.
/Erik Naggum/