creating zope folders and folder content
Hi, I'm pretty new to Zope & Python, and have been making my way through several of the tutorials. Working with External Methods, one of the particularly useful pages came from the Advanced Zope Scripting in the Zope Book, and dealt with creating thumbnails. Everything worked as expected, but I'd like to extend the concept such that , from an External Method, I'd like to create a 'subfolder', then create the thumbnail in the sub-folder. When I prefix the thumbnail file_id with a folder name, I'm getting errors regarding invalid characters in a URL - (which appear to be the / characters separating the folder. I'm assuming this is pretty basic, but haven't been able to find anything on the subject. Any tips or suggestions on where to look, or possibly an Ext Method snippet which would create a sub-folder and a file within the sub-folder? TIA, -- Dan Cherry dscherry@bellsouth.net
# 'self' is the container self.manage_addFolder(folder_id, folder_title) new_folder = getattr(self, folder_id) # create the Zope image object for the new thumbnail new_folder.manage_addProduct['OFSP'].manage_addImage(thumbnail_id, thumbnail_file, 'thumbnail image') Ausum ----- Original Message ----- From: "Dan Cherry" <dscherry@bellsouth.net> To: <zope@zope.org> Sent: Friday, May 07, 2004 6:48 PM Subject: [Zope] creating zope folders and folder content
Hi, I'm pretty new to Zope & Python, and have been making my way through several of the tutorials. Working with External Methods, one of the particularly useful pages came from the Advanced Zope Scripting in the Zope Book, and dealt with creating thumbnails. Everything worked as expected, but I'd like to extend the concept such that , from an External Method, I'd like to create a 'subfolder', then create the thumbnail in the sub-folder. When I prefix the thumbnail file_id with a folder name, I'm getting errors regarding invalid characters in a URL - (which appear to be the / characters separating the folder. I'm assuming this is pretty basic, but haven't been able to find anything on the subject. Any tips or suggestions on where to look, or possibly an Ext Method snippet which would create a sub-folder and a file within the sub-folder?
TIA, -- Dan Cherry dscherry@bellsouth.net
_______________________________________________ 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 )
Thanks - that works perfectly, and acts as a clarification to how objects are addressed from external methods (I failed to use getattr() - so all of my folder references were giving errorst) again, _thank you_! Dan On Saturday 08 May 2004 02:50 am, Ausum Studio wrote:
# 'self' is the container
self.manage_addFolder(folder_id, folder_title) new_folder = getattr(self, folder_id)
# create the Zope image object for the new thumbnail new_folder.manage_addProduct['OFSP'].manage_addImage(thumbnail_id, thumbnail_file, 'thumbnail image')
Ausum
-- Dan Cherry dscherry@bellsouth.net
participants (2)
-
Ausum Studio -
Dan Cherry