[open-ils-commits] r773 - servres/branches/eg-schema-experiment/conifer/evergreen/backends/postgresql_with_schemas (gfawcett)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Feb 8 21:21:14 EST 2010


Author: gfawcett
Date: 2010-02-08 21:21:13 -0500 (Mon, 08 Feb 2010)
New Revision: 773

Modified:
   servres/branches/eg-schema-experiment/conifer/evergreen/backends/postgresql_with_schemas/operations.py
Log:
adjusted last_insert_id method.

The previous implementation was a holdover from an earlier
experiment. This new version actually works. :)

Modified: servres/branches/eg-schema-experiment/conifer/evergreen/backends/postgresql_with_schemas/operations.py
===================================================================
--- servres/branches/eg-schema-experiment/conifer/evergreen/backends/postgresql_with_schemas/operations.py	2010-02-09 02:21:10 UTC (rev 772)
+++ servres/branches/eg-schema-experiment/conifer/evergreen/backends/postgresql_with_schemas/operations.py	2010-02-09 02:21:13 UTC (rev 773)
@@ -3,12 +3,8 @@
 class DatabaseOperations(PostgresDatabaseOperations):
 
     def last_insert_id(self, cursor, table_name, pk_name):
-        if '"' in table_name:
-            table_name = table_name.replace('"', '')
-            cursor.execute("SELECT CURRVAL('%s_%s_seq')" % (table_name, pk_name))
-            return cursor.fetchone()[0]
-        else:
-            return super(DatabaseOperations, self).last_insert_id(cursor, table_name, pk_name)
+        cursor.execute("SELECT CURRVAL('%s_%s_seq')" % (table_name, pk_name))
+        return cursor.fetchone()[0]
 
     def quote_name(self, name):
         if '.' in name:



More information about the open-ils-commits mailing list