[Zope] ExtFile 1.2.0 copying

Ryan T. Bard r.bard at mededu.miami.edu
Fri Jun 4 14:05:53 EDT 2004


In general, I have existing files that are part of a yearly
curriculum. I need to be able to copy them so that a file can be
used from academic year to academic year with any changes to that
file for a given year only occur to that year's file instance.

Any ideas how I would go about creating a new ExtFile object while
using an existing ExtFile object as the file's source? Can this be
done in a DtmlMethod or must I use a python script or external
script to pull this off? When I try to point to an existing ExtFile
object as the file argument in order to force a _copy call, I get an
error. Maybe I am referencing the ExtFile object incorrectly;
however, the fact that the error indicates a problem with the _copy
call itself lends me to believe that the error lies elsewhere.

Details:
The syntax for adding an ExtFile to Zope is manage_addExtFile, with
four arguments:  id, title, description, file. In this example I
have an ExtFile object in a folder called "files", which lies in the
folder "Test". This DtmlMethod is being called from the Test folder
as well. I have even gone as far as to set Proxy permission to
Manager just to see if it is a permissions issue, with no change.

In a DtmlMethod I have:
<dtml-call
"Test.manage_addProduct['ExtFile'].manage_addExtFile('tempfile', '',
'', Test.files['instructions.doc'])">

I get an Attribute Error with the following partial stack trace:

    (Object:
Test.manage_addProduct['ExtFile'].manage_addExtFile('tempfile',
'', '', Test.files['instructions.doc']))
    (Info: Test)
  File &lt;string&gt;, line 2, in f
  File Zope/lib/python/Products/ExtFile/ExtFile.py, line 101, in
manage_addExtFile
    (Object: Test)
  File Zope/lib/python/Products/ExtFile/ExtFile.py, line 371, in
manage_file_upload
    (Object: tempfile)
  File Zope/lib/python/Products/ExtFile/ExtFile.py, line 488, in _copy
    (Object: tempfile)
AttributeError: read


Does it seem to be something I am doing? A problem with the ExtFile
product itself, perhaps? Any ideas?

Thanks!

-- 
Ryan T. Bard
Webmaster/Software Developer
Department of Medical Education
University of Miami School of Medicine






More information about the Zope mailing list