[storm] Commit/ flushes failing

James Henstridge james at jamesh.id.au
Tue Sep 18 11:18:43 BST 2007


On 18/09/2007, akira <nhytro-python at web.de> wrote:
> Hi all,
>
> I´ve noticed something very strange:
>
> from storm.locals import *
>
> database =
> create_database("postgres://voltron:testpassword@localhost:5432/testdb")
>
>
> class User(object):
>     __storm_table__ = "users"
>     id = Int(primary=True)
>     username = Unicode()
>     password = Unicode()
>     email = Unicode()
>
>
> store = Store(database)
> user = User()
> user.username = u'voltron'
> user.password = u'password1'
> user.email = u'email at site.com'

You probably want to include the following here:

store.add(user)

>
> store.flush()

This flush() call is unnecessary as commit() will flush changes for you.

> store.commit()
>
> resultset = jobseeker_store.find(User, User.username == u"voltron")
> print [row.password for row in resultset]
>
> This alway returns an empty resultset. The flush() and commits() do not
> work and absolutely no exceptions or errors are thrown, does anyone else
> have this problem?


James



More information about the storm mailing list