Another Sets Problem
Carsten Haese
carsten.haese at gmail.com
Tue Dec 29 12:14:29 EST 2009
Victor Subervi wrote:
> On Tue, Dec 29, 2009 at 12:54 PM, Carsten Haese <carsten.haese at gmail.com
> <mailto:carsten.haese at gmail.com>> wrote:
>
> Victor Subervi wrote:
> > Since it is difficult to send the inputs but easy to provide the
> > outputs, and as opposed to posting the printout, let me direct you
> here
> > to see it first-hand:
> > http://angrynates.com/cart/enterProducts2.py?store=products
>
> All right, I've gone to that URL. Now what? I see an HTML table, but I
> can't tell how it differs from what you're expecting, because you didn't
> describe what you're expecting.
>
>
> Sorry. The last two fields have "Set({whatever])" when all I want is the
> "whatever" :)
All right. I'm assuming that the following snippet of code is
responsible for that behavior:
elif types[x][0:3] == 'set':
for f in field:
print '<td>%s</td>\n' % (field)
(It's on lines 134-136 of your script if I copied and pasted it from
your previous email correctly.)
In that branch of code, <<field>> is the name of a Set object. You're
iterating over all the elements in that set, giving the name <<f>> to
the individual elements, but then you don't do anything with <<f>>.
Instead, you're printing <<field>>! Printing <<f>> instead would seem to
be a step in the right direction, but I'll readily admit that I didn't
study your code hard enough to determine whether that's the complete
solution.
--
Carsten Haese
http://informixdb.sourceforge.net
More information about the Python-list
mailing list