Hi;
I have the following code:
try:
trueVal = form.getlist(storeColNames[i])
colNames.append(storeColNames[i])
if len(trueVal) > 1:
trueVal = string.join(trueVal, ',')
values.append(trueVal)
elif len(trueVal) == 1:
print storeColNames[i], trueVal, '<br />'
trueVal = '%s' % trueVal[0]
values.append(trueVal)
if len(trueVal) > 0:
sql = '%s="%s"' % (storeColNames[i], trueVal)
sqlUpdate.append(sql)
except:
raise
This works fine except when storeColNames[i] returns no data. Now, if I were
dealing with getfirst instead of getlist, I could easily put in a nonsense
default data value such as '%$#' and check for that. But how can I do that
or something similar (and preferably more elegant) with getlist, which takes
only the one name parameter?
TIA,
beno
--
http://mail.python.org/mailman/listinfo/python-list