Author: phd
Date: Sun May 13 09:54:50 2012
New Revision: 4526
Log:
Merged revision 4525 from branch 1.3: fixed a minor bug in PostgreSQL introspection.
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/docs/TODO.txt
SQLObject/trunk/sqlobject/postgres/pgconnection.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sun May 13 09:52:34 2012 (r4525)
+++ SQLObject/trunk/docs/News.txt Sun May 13 09:54:50 2012 (r4526)
@@ -10,6 +10,11 @@
SQLObject (trunk)
=================
+SQLObject 1.3.1
+===============
+
+* A bugfix was ported from `SQLObject 1.2.3`_.
+
SQLObject 1.3.0
===============
@@ -25,6 +30,12 @@
rewritten and extended; ``charset`` was renamed to ``dbEncoding``;
a longstanding bug was fixed - pass port to connect().
+SQLObject 1.2.3
+===============
+
+* Fixed a minor bug in PostgreSQL introspection: VIEWs don't have
+ PRIMARY KEYs - use sqlmeta.idName as the key if there is no one.
+
SQLObject 1.2.2
===============
Modified: SQLObject/trunk/docs/TODO.txt
==============================================================================
--- SQLObject/trunk/docs/TODO.txt Sun May 13 09:52:34 2012 (r4525)
+++ SQLObject/trunk/docs/TODO.txt Sun May 13 09:54:50 2012 (r4526)
@@ -47,6 +47,8 @@
* Create JSONCol.
+* Make version_info a namedtuple.
+
* Stop supporting Python 2.6: restore using urllib.splituser in _parseURI.
* Expression columns - in SELECT but not in INSERT/UPDATE. Something like this::
Modified: SQLObject/trunk/sqlobject/postgres/pgconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/postgres/pgconnection.py Sun May 13 09:52:34 2012 (r4525)
+++ SQLObject/trunk/sqlobject/postgres/pgconnection.py Sun May 13 09:54:50 2012 (r4526)
@@ -289,6 +289,9 @@
assert match, "Unparseable contraint definition: %r" % indexDef
assert primaryKey is None, "Already found primary key (%r), then found: %r" % (primaryKey, indexDef)
primaryKey = match.group(1)
+ if primaryKey is None:
+ # VIEWs don't have PRIMARY KEYs - accept help from user
+ primaryKey = soClass.sqlmeta.idName
assert primaryKey, "No primary key found in table %r" % tableName
if primaryKey.startswith('"'):
assert primaryKey.endswith('"')
|