<div class="gmail_quote">On Thu, Dec 3, 2009 at 6:07 AM, Victor Subervi <span dir="ltr"><<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote">On Wed, Dec 2, 2009 at 4:08 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com" target="_blank">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div>Victor Subervi wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi;<br>
I have spent 2-3 hours trying to track this bug. Here's the code snippet:<br>
<br>
form = cgi.FieldStorage()<br>
fn = getattr(options, 'products')<br>
ourOptionsNames = []<br>
optionsNames, doNotUse = fn('names')<br>
for name in optionsNames:<br>
test = table + '-' + name<br>
print test<br>
check = form.getfirst(test, '')<br>
print check<br>
if check != '':<br>
ourOptionsNames.append(name)<br>
Now, when it looks through with test=='products', it doesn't report that any of the values from the form are checked. However, when I explicitly write out something like:<br>
print form.getfirst('products-sizes', '')<br>
which I checked on the form from the referring page, it does in fact print out! My test prints show that 'products-sizes' is being passed to "check" and should therefore be appended to "ourOptionsNames". But it isn't! What am I missing here??<br>
<br>
</blockquote></div></div>
What do the print statements actually print? Please copy and paste their<br>
output.<br></blockquote><div><br></div></div>For the part in question they print __nothing__. That's the point. <br><font color="#888888">V<br>
</font></blockquote></div>I believe I mentioned in my first post that the "print test" does print the exact fields being called from the referring page. The "print check" prints nothing. Another thing that's strange is that there are two tables of fields in the referrer page; it will print the first of those tables--whichever of the two I choose--but not the latter. Perhaps this is a bug in the cgi interface? Perhaps I should migrate this to mod_python?<br>
TIA,<br>V<br>