Re: [Zope] Inserting a variable in a context.manage statement in Python
23 Apr
2002
23 Apr
'02
1:33 p.m.
c = REQUEST.get('clearing_id','') context.manage_addFolder(c) # this works # Now what I want to do is add a document to the folder # If I include a hard-coded value for the folder name I just created as a test, it works # But this doesn't: context.c.manage_addDocument('NewDoc')
I think you should be able to do either of (both untested): getattr(context, c).manage_addDocument('NewDoc') context[c].manage_addDocument('NewDoc') As far as I understand, your version doesn't work because you are telling python/zope to look for the c string object that is an attribute of context, instead of telling it to get hold of the attribute of context that is called whatever str(c) returns. hth tim
8749
Age (days ago)
8749
Last active (days ago)
0 comments
1 participants
participants (1)
-
tim