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 <string>, 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
Why not use copy/paste? cb = sourcefolder.manage_copyObjects(['myfile']) destfolder.manage_pasteObjects(cb) Stefan On Freitag, Jun 4, 2004, at 20:05 Europe/Vienna, Ryan T. Bard wrote:
Any ideas how I would go about creating a new ExtFile object while using an existing ExtFile object as the file's source?
-- The time has come to start talking about whether the emperor is as well dressed as we are supposed to think he is. /Pete McBreen/
participants (2)
-
Ryan T. Bard -
Stefan H. Holek