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/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss