Re: Some newbie cgi form questions...

2005-08-07 Thread googleboy
Robert Kern wrote: > Diez B.Roggisch wrote: > >>Traceback (most recent call last): > >> File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ? > >>if not form.keys()[key]: > >>TypeError: list indices must be integers > >> > >>As you can see, I am using python 2.3 (my web service

Re: Some newbie cgi form questions...

2005-08-07 Thread Robert Kern
Diez B.Roggisch wrote: >>Traceback (most recent call last): >> File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ? >>if not form.keys()[key]: >>TypeError: list indices must be integers >> >>As you can see, I am using python 2.3 (my web service provider is >>responsible for thi

Re: Some newbie cgi form questions...

2005-08-07 Thread Diez B.Roggisch
> Traceback (most recent call last): > File "/var/www/users/senta/html/gobooks/cgi/form.py", line 35, in ? > if not form.keys()[key]: > TypeError: list indices must be integers > > As you can see, I am using python 2.3 (my web service provider is > responsible for this - I'd use 2.4.1 if I

Re: Some newbie cgi form questions...

2005-08-07 Thread Devan L
googleboy wrote: > for key in form.keys():Yes, I know which fields are hidden because I > made them that way, but I am trying to figure out a way I can iterate > over the fields and do one thing with hidden fields (assign them to > variables that tell the form how to process) and a different th

Re: Some newbie cgi form questions...

2005-08-07 Thread googleboy
for key in form.keys():Yes, I know which fields are hidden because I made them that way, but I am trying to figure out a way I can iterate over the fields and do one thing with hidden fields (assign them to variables that tell the form how to process) and a different thing with non hidden fields

Re: Some newbie cgi form questions...

2005-08-07 Thread Diez B.Roggisch
> The second for loop is an attempt at trying to print all the values > that were entered on the for without presenting the hidden values. I'd > really like to do this, but I can't seem to figure out how to make a > special case for hidden form values, nor can I find an example of how > to do it i

Re: Some newbie cgi form questions...

2005-08-07 Thread Paul Rubin
"Atila Olah" <[EMAIL PROTECTED]> writes: > for key in form.keys(): > if not form.keys()[key]: # True if it's a value is None Ugh! I think you mean for key, value in form.items(): if not value: These days you can also say iteritems instead of items and avoid building a potentially

Re: Some newbie cgi form questions...

2005-08-07 Thread Atila Olah
>for key in form.keys(): >if not form.has_key(key): # it will always be True try this: for key in form.keys(): if not form.keys()[key]: # True if it's a value is None Well, I don't exactly know the methods of the CGI module, but there are ways to access form data in Apache's mod_python m

Some newbie cgi form questions...

2005-08-07 Thread googleboy
Hi there. I am having a bit of a play with teh cgi module, trying to figure out how to process a web form. I have come a little ways from reading up variou sexamples and tutes that I've found on the net, but they all leave me with a couple of questions: My code below has an attempt at validation