From 237ace5f7f971a20e6bcc73785a26a1a08481ce8 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Wed, 7 Aug 2013 07:29:02 -0500 Subject: [PATCH] minor edits in dal --- VERSION | 2 +- gluon/dal.py | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 569f6b1c..52af9633 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.6.0-development+timestamp.2013.08.07.07.03.01 +Version 2.6.0-development+timestamp.2013.08.07.07.28.14 diff --git a/gluon/dal.py b/gluon/dal.py index 786d887c..57b5585d 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -1076,16 +1076,18 @@ class BaseAdapter(ConnectionPool): elif not key in sql_fields: del sql_fields_current[key] ftype = sql_fields_old[key]['type'] - if self.dbengine in ('postgres',) and ftype.startswith('geometry'): + if (self.dbengine in ('postgres',) and + ftype.startswith('geometry')): geotype, parms = ftype[:-1].split('(') schema = parms.split(',')[0] - query = [ "SELECT DropGeometryColumn ('%(schema)s', '%(table)s', '%(field)s');" % + query = [ "SELECT DropGeometryColumn ('%(schema)s', "+ + "'%(table)s', '%(field)s');" % dict(schema=schema, table=tablename, field=key,) ] elif self.dbengine in ('firebird',): query = ['ALTER TABLE %s DROP %s;' % (tablename, key)] else: - query = ['ALTER TABLE %s DROP COLUMN %s;' - % (tablename, key)] + query = ['ALTER TABLE %s DROP COLUMN %s;' % + (tablename, key)] metadata_change = True elif sql_fields[key]['sql'] != sql_fields_old[key]['sql'] \ and not (key in table.fields and @@ -1124,8 +1126,10 @@ class BaseAdapter(ConnectionPool): self.log('faked!\n', table) else: self.execute(sub_query) - # Caveat: mysql, oracle and firebird do not allow multiple alter table - # in one transaction so we must commit partial transactions and + # Caveat: mysql, oracle and firebird + # do not allow multiple alter table + # in one transaction so we must commit + # partial transactions and # update table._dbt after alter table. if db._adapter.commit_on_alter_table: db.commit()