3 Mar
2004
3 Mar
'04
10:19 a.m.
Philip Kilner wrote:
Hi List,
Can't figure this out - need help!
In a Script (Python), I'm testing for the presence (or more precisely the absence) of a key in the request, like so: -
request=context.REQUEST
if not request.has_key('the_key'):
The problem is that the test always fails (e.g. it acts as though the key is absent, even when it is not). If I modify the test to check for a form filed, it works fine.
What am I doing wrong?
Request is not a dictionary, it just behaves simmilar. You could use sommething like: the_key = request.get('the_key', None): if the_key ... robert