On Wed, Jul 29, 2009 at 04:57:12PM +1200, Aaron Robinson wrote:
> First off, the point you raised about setting many values at once; yes, I
> was aware of this, but a lot of the things we seem to want to do are more
> like we have a dict with strings for keys and associated values, and we want
> to write them into the db in one go, where the strings are the column names
> - is there's some way to do a myObject.set(), and pass in a dictionary?
.set(**dict)
> is there any way to do transactions with SQLObject's?
transaction = connection.transaction()
and use the transaction object everywhere instead of connection:
sqlobject.sqlhub = transaction
or
class Table(SQLObject):
_connection = transaction
or
Table.select(..., connection=transaction, ...)
and so on. You don't need all at once - just choose a way you want it.
Don't forget to do transaction.commit() at the end.
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ ph...@ph...
Programmers don't die, they just GOSUB without RETURN.
|