Author: ianb
Date: 2005-02-01 06:45:18 +0000 (Tue, 01 Feb 2005)
New Revision: 563
Modified:
trunk/SQLObject/sqlobject/dbconnection.py
trunk/SQLObject/sqlobject/postgres/pgconnection.py
Log:
* Add attributes like user, host, db to postgres connections, so that
we can recreate the URI
* Fixed an assert in dbconnection (NameError)
Modified: trunk/SQLObject/sqlobject/dbconnection.py
===================================================================
--- trunk/SQLObject/sqlobject/dbconnection.py 2005-02-01 06:19:19 UTC (rev 562)
+++ trunk/SQLObject/sqlobject/dbconnection.py 2005-02-01 06:45:18 UTC (rev 563)
@@ -50,7 +50,7 @@
auth = auth + '@' + self.password
auth = auth + ':'
else:
- assert not password, 'URIs cannot express passwords without usernames'
+ assert not self.password, 'URIs cannot express passwords without usernames'
uri = '%s://%s' % (self.dbName, auth)
if self.host:
uri += self.host + '/'
Modified: trunk/SQLObject/sqlobject/postgres/pgconnection.py
===================================================================
--- trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-02-01 06:19:19 UTC (rev 562)
+++ trunk/SQLObject/sqlobject/postgres/pgconnection.py 2005-02-01 06:45:18 UTC (rev 563)
@@ -29,6 +29,10 @@
registerConverter(type(psycopg.Binary('')),
PsycoBinaryConverter)
+ self.user = user
+ self.host = host
+ self.db = db
+ self.password = passwd
if dsn is None:
dsn = []
if db:
|