# HG changeset patch # User James Bergstra # Date 1232335076 18000 # Node ID 25d9f91f1afa68be966473681d00ccb5f1e29653 # Parent ae954c27fd11178cd842a734e86ca118a4e2f9ad fixing session management in db dict update diff -r ae954c27fd11 -r 25d9f91f1afa pylearn/dbdict/api0.py --- a/pylearn/dbdict/api0.py Sun Jan 18 22:00:16 2009 -0500 +++ b/pylearn/dbdict/api0.py Sun Jan 18 22:17:56 2009 -0500 @@ -197,10 +197,7 @@ del d_self._attrs[i] if commit_close: s.commit() - #s.add(d_self) #why is this here? maybe it should go earlier?? s.close() - else: - pass def iteritems(d_self): return d_self.items() @@ -222,6 +219,7 @@ else: s = session commit_close = False + s.add(d_self) for k, v in dct.items(): d_self._set_in_session(k, v, s) for k, v in kwargs.items(): @@ -230,8 +228,6 @@ if commit_close: s.commit() s.close() - else: - s.add(d_self) #why is this here? maybe it should go earlier?? def get(d_self, key, default): try: @@ -284,7 +280,7 @@ if key == 'dbdict.status': ival = int(val) d_self.status = ival - if key == 'dbdict.priority': + if key == 'dbdict.sql.priority': fval = float(val) d_self.priority = fval