[storm] storm..SQLite too picky about unicode column contents
Håvard Gulldahl
havard at lurtgjort.no
Sun Aug 26 23:43:38 BST 2007
Hello, list.
First off, thanks for storm.
Then, to something that confuses me wildly. I have a table where some
columns are sometimes strings and sometimes ints, so I've declared
them as UNICODE in my CREATE TABLE sql.
I'm having trouble reading that column back, if the value is a number
(all integers). I've attached a test case highlighting my woes, here's
the error message:
TypeError: Expected unicode, found <type 'int'>: 9001
Is this expected behaviour? (I surely didn't expect it... ;)
For the time being I've worked around this issue by prepending a
string to the column before it is flushed, with the
__storm_pre_flush__ hook (see attachment) -- but I'm hoping that I
won't have to in the future.
Take care,
--
Håvard Gulldahl <havard at gulldahl.no>
Telefon: 9971 0615
http://lurtgjort.no/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: storm-bug-picky-column-contents-testcase.py
Type: text/x-python
Size: 823 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/storm/attachments/20070827/ce219913/attachment.py
More information about the storm
mailing list