Hi,
I have a problem with the "Photo" product. I want to create a Photo
object from an existing Image object.
I have a form with id and title input tags which are initialized with
appropriate values from a special folder where
the Image objects resides
.
Now I have written a PythonSript to handle the creation of a new Photo
object
#id1,title1 image id and tile
def doAddPhoto(id1, title1):
# some comments
....
img = context.getObjectById(id1) # this returns the object part of
object item array from context.objectItems
s="ph" +str(id1)
context.manage_addPhoto(id=s, file=img.data,title=title1,
displays=None, precondition='', content_type='image/jpeg') (line 12)
If I submit the form, an error occurs:
Traceback (innermost last):
Module ZPublisher.Publish, line 101, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 306, in __call__
Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 323, in _exec
Module None, line 12, in doAddPhoto
- <PythonScript at /www.ecommerce.de/doAddPhoto>
- Line 12
AttributeError: manage_addPhoto
When I try it with context.manage_addImage everything works fine.
I can't figure out why the above Exception is thrown, the source code
of Photo's manage_addPhoto function looks as similar as the
manage_addImage function of the Image class (from which Photo is derived)
and i have no clue where the pitfall is.
Does anybody have an idea or a hint?
Help would be appreciate.
Thanks in advance
Thomas Adams
begin:vcard
fn:Thomas Adams
n:Adams;Thomas
adr;quoted-printable:;;Schwanthalerstr. 184;M=C3=BCnchen;Bayern;80339;Deutschland
email;internet:[EMAIL PROTECTED]
tel;work:089 55 186 500
tel;home:089 54 03 28 96
version:2.1
end:vcard
_______________________________________________
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 )