So this example from the docs would now look like what?
conn = DBConnection.PostgresConnection('yada')
trans = conn.transaction()
p = Person.get(1, trans)
p.firstName = 'Bob'
trans.commit()
p.firstName = 'Billy'
trans.rollback()
-----Original Message-----
From: Ian Bicking [mailto:ia...@co...]
Sent: Friday, April 16, 2004 3:21 PM
To: Philippe Normand
Cc: sql...@li...
Subject: Re: [SQLObject] connection URIs
Philippe Normand wrote:
> On Fri, Apr 16, 2004 at 01:48:29PM -0400, jws...@ra...
wrote:
>
>>I'm switching to 0.6 and it's not obvious how to setup the new style
URI's.
>>Do I need to assign the URI to __connection__ ,
>>_connection , or conn ?
>
> Use __connection__ like in 0.5 .. Table._connection can also be used
> as before. The only thing which changed is the way to assign it:
>
> __connection__ = dbconnection.connectionForURI(dbURI)
Yes, that's the best way to do it. You can use a string alone in some
places as well (e.g., __connection__ = dbURI), but I think I'm going to
take that out because it can't be made to work everywhere you might
specify a connection (while connectionForURI() will work).
Ian
|