summaryrefslogtreecommitdiff
path: root/migrate
diff options
context:
space:
mode:
authorGabriel <g2p.code+sqla@gmail.com>2011-06-29 13:33:44 +0200
committerGabriel <g2p.code+sqla@gmail.com>2011-06-29 13:33:44 +0200
commit75df12b2274b78a5d8cae40dfb13a71caaa894e2 (patch)
tree6bf968ee541f9d64c7accf9d35980e056a98deed /migrate
parentbf2fcaf2ee8797decde1b6a70bfb34663d34349f (diff)
downloadsqalchemy-migrate-75df12b2274b78a5d8cae40dfb13a71caaa894e2.tar.gz
More pep8 compliant declarative output.
https://code.google.com/p/sqlalchemy-migrate/issues/detail?id=122
Diffstat (limited to 'migrate')
-rw-r--r--migrate/versioning/genmodel.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/migrate/versioning/genmodel.py b/migrate/versioning/genmodel.py
index b3449b6..5c235da 100644
--- a/migrate/versioning/genmodel.py
+++ b/migrate/versioning/genmodel.py
@@ -101,15 +101,17 @@ class ModelGenerator(object):
tableName = table.name
if self.declarative:
out.append("class %(table)s(Base):" % {'table': tableName})
- out.append(" __tablename__ = '%(table)s'" % {'table': tableName})
+ out.append(" __tablename__ = '%(table)s'\n" %
+ {'table': tableName})
for col in table.columns:
- out.append(" %s" % self.column_repr(col))
+ out.append(" %s" % self.column_repr(col))
+ out.append('\n')
else:
- out.append("%(table)s = Table('%(table)s', meta," % \
- {'table': tableName})
+ out.append("%(table)s = Table('%(table)s', meta," %
+ {'table': tableName})
for col in table.columns:
- out.append(" %s," % self.column_repr(col))
- out.append(")")
+ out.append(" %s," % self.column_repr(col))
+ out.append(")\n")
return out
def _get_tables(self,missingA=False,missingB=False,modified=False):
@@ -133,7 +135,6 @@ class ModelGenerator(object):
out.append("")
for table in self._get_tables(missingA=True):
out.extend(self.getTableDefn(table))
- out.append("")
return '\n'.join(out)
def toUpgradeDowngradePython(self, indent=' '):