From 3792e291e6aee9cd43a48fac33f19a6ab24920d2 Mon Sep 17 00:00:00 2001 From: Curtis Maloney Date: Mon, 11 Jan 2016 09:06:33 +1100 Subject: [PATCH] Removed use of locals for print formatting in Oracle backend. --- django/db/backends/oracle/operations.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py index 0651105d9f..3eebd7d979 100644 --- a/django/db/backends/oracle/operations.py +++ b/django/db/backends/oracle/operations.py @@ -44,10 +44,12 @@ END; def autoinc_sql(self, table, column): # To simulate auto-incrementing primary keys in Oracle, we have to # create a sequence and a trigger. - sq_name = self._get_sequence_name(table) - tr_name = self._get_trigger_name(table) - tbl_name = self.quote_name(table) - col_name = self.quote_name(column) + args = { + 'sq_name': self._get_sequence_name(table), + 'tr_name': self._get_trigger_name(table), + 'tbl_name': self.quote_name(table), + 'col_name': self.quote_name(column), + } sequence_sql = """ DECLARE i INTEGER; @@ -58,7 +60,7 @@ BEGIN EXECUTE IMMEDIATE 'CREATE SEQUENCE "%(sq_name)s"'; END IF; END; -/""" % locals() +/""" % args trigger_sql = """ CREATE OR REPLACE TRIGGER "%(tr_name)s" BEFORE INSERT ON %(tbl_name)s @@ -68,7 +70,7 @@ WHEN (new.%(col_name)s IS NULL) SELECT "%(sq_name)s".nextval INTO :new.%(col_name)s FROM dual; END; -/""" % locals() +/""" % args return sequence_sql, trigger_sql def cache_key_culling_sql(self):