bloody newbie: access to subfolders [from python]
here we go for another stupid newbie question: I'm trying to deal with a subfolder within a pythonscript. I'll have to add to properties and to store a file from an upload form. I tried it as follows--- [id shall be the name of the subfolder and is given by me] container._.getitem(id).manage_addProperty('user',AUTHENTICATED_USER.getName(),'string') container._.getitem(id).manage_addProperty('data',ZopeTime().strftime('%m/%d/%Y- %I:%M%p'),'string') container._.getitem(id).manage_addProduct['OFSP'].manage_addFile(id+'.pdf',context.REQUEST['pdf']) by trying out this, I discovered a access proplem: I'm logged in as admin, but the script won't work. So: What's the problem with it? note: everything I try with "container._.getitem(id)" fails 'cos of access props, but I don't know how to do it alright [I mean refering to the subfolder] could somebody please help me [again]? thx, Christian
Try something like (untested): getattr(container,'id').manage_addProduct['OFSP'].manage_addFile(id+'.pdf',c ontext.REQUEST['pdf']) ----- Original Message ----- From: "C. Koehler" <Sir-XaoS@gmx.net> To: "zope [eng]" <Zope@zope.org> Sent: Wednesday, June 27, 2001 2:02 PM Subject: [Zope] bloody newbie: access to subfolders [from python]
here we go for another stupid newbie question:
I'm trying to deal with a subfolder within a pythonscript. I'll have to add to properties and to store a file from an upload form. I tried it as follows---
[id shall be the name of the subfolder and is given by me]
container._.getitem(id).manage_addProperty('user',AUTHENTICATED_USER.getName (),'string')
container._.getitem(id).manage_addProperty('data',ZopeTime().strftime('%m/%d /%Y-
%I:%M%p'),'string')
container._.getitem(id).manage_addProduct['OFSP'].manage_addFile(id+'.pdf',c ontext.REQUEST['pdf'])
by trying out this, I discovered a access proplem: I'm logged in as admin, but the script won't work. So: What's the problem with it? note: everything I try with "container._.getitem(id)" fails 'cos of access props, but I don't know how to do it alright [I mean refering to the subfolder]
could somebody please help me [again]? thx, Christian
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
C. Koehler -
Phil Harris