[Zope] external method problems

auto44082@hushmail.com auto44082@hushmail.com
Wed, 23 Feb 2000 15:50:47 -0800 (PST)


This is probably really simple to those of you who have been doing this 
for a while, but I'm just starting and need some help.

I'm creating a zope product consisting of a ZClass which inherrits the DTML 
Document and the Object Manager. (The Idea is it will be allowed to contain 
other objects) I've got an external method defined and that part seems to 
work OK. (I've done the standard hello world test, etc.) Where I'm getting 
hung up, is I'm trying to upload an external file to this new object, by 
calling the objects manage_addFile method followed by the manage_upload 
method. The idea is to create an empty file within my new object, then replace 
it's contents with the uploaded file, which was specified in a browse field 
when the object was created.

I'm calling the external method that does this from the add constructor 
of my object. Everything seems to work fine, no errors etc. However, when 
I try and access the contents of the supposedly uploaded file from within 
my new object, say in a <dtml-var> tag. I get object not found errors.

Unfortunately I'm not experianced enough at this yet for my problem to be 
immediately obvious to me. If one of you out there feels inclined to explain 
to me how this shoudl work I would greatly appreciate it. For your reference,
 here's the python code of my external method such as it is.

Thanks a million!

def getFile(self, REQUEST):
        """A simple external method."""
        f1=REQUEST.new_file
        self.manage_addFile('temp',f1)
        self.temp.manage_upload([REQUEST.new_file,REQUEST])




IMPORTANT NOTICE:  If you are not using HushMail, this message could have been read easily by the many people who have access to your open personal email messages.
Get your FREE, totally secure email address at http://www.hushmail.com.