I've been implementing my own thing similar to an orm, but decided to
give up on reinventing the wheel. That was at about the time that
Storm was released, and I have to say, I'm impressed.
I have run into a bit of a problem. From what I've gleamed, my
included script is what I'm suppose to do, but I get this error (with
print statements in Connection._raw_execute for statements and params
to help
Two warnings:
I'm fairly novice in sql though I've been programming for years
I have been unable to find any storm examples using lists
=======================
CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT, fields BLOB)
INSERT INTO test (fields, name) VALUES (?, ?)
([], u'Blank')
Traceback (most recent call last):
File "./bug_example.py", line 20, in <module>
store.commit()
File "/media/data/Personal/Development/FamilyHistory/src/storm/store.py",
line 66, in commit
self.flush()
File "/media/data/Personal/Development/FamilyHistory/src/storm/store.py",
line 274, in flush
self._flush_one(obj_info)
File "/media/data/Personal/Development/FamilyHistory/src/storm/store.py",
line 313, in _flush_one
result = self._connection.execute(expr)
File "/media/data/Personal/Development/FamilyHistory/src/storm/database.py",
line 139, in execute
raw_cursor = self._raw_execute(statement, params)
File "/media/data/Personal/Development/FamilyHistory/src/storm/database.py",
line 128, in _raw_execute
raw_cursor.execute(statement, params)
pysqlite2.dbapi2.InterfaceError: Error binding parameter 0 - probably
unsupported type.
=======================
Is this a bug on my part or on Storm's?
Thanks
Ed Page
ps Any good feel for when to use AutoReload?
#!/usr/bin/env python
import storm.locals as orm
class Test(object):
__storm_table__ = "test"
id = orm.Int(default=orm.AutoReload, primary=True)
name = orm.Unicode(default=u"Blank")
fields = orm.List(type=orm.Unicode(default=u""), default_factory=list)
if __name__ == "__main__":
database = orm.create_database ("sqlite:")
store = orm.Store(database)
store.execute ("CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT, fields BLOB)", noresult=True)
test = Test()
store.add (test)
store.commit()
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm