In article ,
__pete...@web.de says...
>
> self.data = dict(row)
I didn't realize from the documentation it could be this simple. Thanks.
>
> And now an unsolicited remark: if you have more than one instance of Unknown
> you might read the data outside the initialiser or at least keep the
> c
Mario Figueiredo wrote:
> Currently i'm using the following code to transform a row fetched from an
> sqlite database into a dictionary property:
class Unknown:
> def __init__(self, id_):
> self.id = id_
> self.data = None
> ...
> conn = sqlite3.connect('data'
Currently i'm using the following code to transform a row fetched from an
sqlite database into a dictionary property:
def __init__(self, id_):
self.id = id_
self.data = None
...
conn = sqlite3.connect('data')
conn.row_factory = sqlite3.Row
row = conn.