librelist archives

« back to archive

[PATCH] fix some bugs

[PATCH] fix some bugs

From:
Mikhail Krivushin
Date:
2010-08-01 @ 22:30
# HG changeset patch
# User Mikhail Krivushin <krivushinme@gmail.com>
# Date 1280701367 -14400
# Node ID 4c2eec63fcb5f5e8766afb410027fb77f01dfad0
# Parent  9e56b3a31e9d03aea2f07c9f82ccba7c4c5241ec
fix some bugs

diff -r 9e56b3a31e9d -r 4c2eec63fcb5 svargaext/sqlamigrate/commands.py
--- a/svargaext/sqlamigrate/commands.py	Wed Jun 16 18:25:31 2010 +0300
+++ b/svargaext/sqlamigrate/commands.py	Mon Aug 02 02:22:47 2010 +0400
@@ -57,7 +57,7 @@
                   version=('v', '1', 'initial repository version')):
     '''Create necessary tables in the database
     '''
-    app = apps.get_apps().get_app(appname)
+    app = apps.get_app(appname)
     repository = app.get_repository_path()
 
     try:
diff -r 9e56b3a31e9d -r 4c2eec63fcb5 svargaext/sqlamigrate/files.py
--- a/svargaext/sqlamigrate/files.py	Wed Jun 16 18:25:31 2010 +0300
+++ b/svargaext/sqlamigrate/files.py	Mon Aug 02 02:22:47 2010 +0400
@@ -29,7 +29,7 @@
     print 'Created version %s' % ver
 
 def read_template(name):
-    from svarga.contrib.sqlamigrate import templates
+    from svargaext.sqlamigrate import templates
     source = os.path.join(os.path.dirname(templates.__file__), name)
 
     f = file(source, 'r')
diff -r 9e56b3a31e9d -r 4c2eec63fcb5 
svargaext/sqlamigrate/templates/script.py_tmpl
--- a/svargaext/sqlamigrate/templates/script.py_tmpl	Wed Jun 16 18:25:31 
2010 +0300
+++ b/svargaext/sqlamigrate/templates/script.py_tmpl	Mon Aug 02 02:22:47 
2010 +0400
@@ -9,13 +9,13 @@
 %(init)s
 
 @transaction
-def upgrade(conn):
-    meta.bind = conn
+def upgrade():
+    meta.bind = env.sqla.engine
 
 %(upgrade)s
 
 @transaction
-def downgrade(conn):
-    meta.bind = conn
+def downgrade():
+    meta.bind = env.sqla.engine
 
 %(downgrade)s
diff -r 9e56b3a31e9d -r 4c2eec63fcb5 svargaext/sqlamigrate/utils.py
--- a/svargaext/sqlamigrate/utils.py	Wed Jun 16 18:25:31 2010 +0300
+++ b/svargaext/sqlamigrate/utils.py	Mon Aug 02 02:22:47 2010 +0400
@@ -44,6 +44,6 @@
         if changeset.step < 0:
             print "Reverting %s..." % ver
         else:
-            print "Applying %s..." % (ver+1)
+            print "Applying %s..." % (ver+1), ver, change, changeset.step
 
         s.runchange(ver, change, changeset.step)