need to get item from string in Python Script
6 Feb
2001
6 Feb
'01
7:04 p.m.
Can someone tell me how to do the equivalent of <dtml-var "_.getitem(REQUEST['variablenameinastring'])"> in PythonScript Troy
7 Feb
7 Feb
9:45 a.m.
New subject: [Zope] need to get item from string in Python Script
"Farrell, Troy" wrote:
Can someone tell me how to do the equivalent of <dtml-var "_.getitem(REQUEST['variablenameinastring'])"> in PythonScript
Go to the bindings tab and bind the namespace to _. (Not sure why this wasn't done by default :-S) Then just do: _.getitem(context.REQUEST['variablenameinastring']) I wonder why REQUEST isn't one of the things you can bind. Or RESPONSE for that matter :-S cheers, Chris PS: answer to own question: put REQUEST and RESPONSE in the parameter list :-) (If you do that, you don't need to 'context.' before the REQUEST above...)
9189
Age (days ago)
9190
Last active (days ago)
1 comments
2 participants
participants (2)
-
Chris Withers -
Farrell, Troy