From: gfawcett Date: Tue, 9 Feb 2010 02:21:13 +0000 (+0000) Subject: adjusted last_insert_id method. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0ab64b0a3dab6b318aa3b6f742ef45e2f6bc8f1f;p=Syrup.git adjusted last_insert_id method. The previous implementation was a holdover from an earlier experiment. This new version actually works. :) git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/branches/eg-schema-experiment@773 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/evergreen/backends/postgresql_with_schemas/operations.py b/conifer/evergreen/backends/postgresql_with_schemas/operations.py index b013bb6..e7b3fdb 100644 --- a/conifer/evergreen/backends/postgresql_with_schemas/operations.py +++ b/conifer/evergreen/backends/postgresql_with_schemas/operations.py @@ -3,12 +3,8 @@ from django.db.backends.postgresql.operations import DatabaseOperations as Postg 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: