MySQL set and enum, calling values

Victor Subervi victorsubervi at gmail.com
Sat Dec 12 03:04:46 EST 2009


On Fri, Dec 11, 2009 at 8:13 PM, Gabriel Genellina
<gagsl-py2 at yahoo.com.ar>wrote:

> En Fri, 11 Dec 2009 16:28:23 -0300, Victor Subervi <
> victorsubervi at gmail.com> escribió:
>
>  On Fri, Dec 11, 2009 at 3:12 PM, Carsten Haese <carsten.haese at gmail.com
>> >wrote:
>>
>>  Victor Subervi wrote:
>>> > [...] if I go to print, say,
>>> > colFieldValues[20], which is a set, it prints out the whole set:
>>> >
>>> set('Extra-small','Small','Medium','Large','XLarge','XXLarge','XXXLarge')
>>> > But if I print out colFieldValues[20][0], it prints out "s".
>>>
>>> > Also, how can I test
>>> > for it? It's an instance of string. How do I know if it's a set?
>>>
>>> That's a fantastic question. Python thinks it's a string. What makes you
>>> think it's a set?
>>>
>>
>> Right. I'm doing it the ugly way with the truncating tuple and string
>> replace.
>>
>
> Are you sure the column is declared as SET and not, say, VARCHAR?
>

yes


> Anyway, I don't think MySQLdb is able to handle the SET data type
> correctly.
>

Oh, lovely! What do?
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091212/2e4fffb3/attachment-0001.html>


More information about the Python-list mailing list