[Zope] manage_addImage from python
Michel Vayssade
michel.vayssade@utc.fr
Tue, 23 Oct 2001 11:30:55 +0200 (MET DST)
On Mon, 22 Oct 2001, Oleg Broytmann wrote:
> On Mon, Oct 22, 2001 at 12:11:34PM +0200, Michel Vayssade wrote:
> > Inside python code I tried using :
> > self.manage_addImage('newid','localfs/image.gif',content_type='image/gif')
> >
> > the "newid" object is created
> > but its content is the STRING "localfs/image.gif"
> > where I expected the CONTENT of the file localfs/image.gif
> >
> > what do I miss ?
> You missed exactly this - content :) Put the content of the object
> instead of its name as the second parameter.
right !
ok here is the code that work :
file = "filesystem/myimage.gif"
ffi = open(file, 'r')
self.manage_addImage('imageid',ffi,content_type='image/gif')
ffi.close()
and OK
but now :
trying the "same" trick with :
name = 'myfile'
file = name+'.py' # the file is Extentions/myfile.py
ffi = open(file, 'r')
self.manage_addExternalMethod (name,name,ffi,'mymethod')
ffi.close()
I got :
Error Type: AttributeError
Error Value: manage_addExternalMethod
I have done:
from Products.ExternalMethod.ExternalMethod import
manage_addExternalMethod
I tried a lot of ways calling this method, but none work ..
Probably somebody has already get it work ?
thanks
the list is very helpfull
at least its good for morale seeing you are not alone in the dark :)
--
_/ _/ _/_/_/ _/_/ Michel.Vayssade@UTC.fr Service Informatique
_/ _/ _/ _/ T:33/0-3.44.23.49.24 Universite de Technologie
_/ _/ _/ _/ F:33/0-3.44.23.46.77 BP 20.529 60205 Compiegne
_/_/ _/ _/_/ _ mv@utc.fr __/www.utc.fr/~vayssade____ France