From: Drew Fisher Date: Wed, 12 Mar 2014 17:45:10 +0000 (-0700) Subject: avoid name conflict on 'api' X-Git-Url: https://git.zarvox.org/shortlog/month?a=commitdiff_plain;h=aa8afbf7febbf26d49001061351b6cdc8d51b78f;p=imoo.git avoid name conflict on 'api' --- diff --git a/imoo/__init__.py b/imoo/__init__.py index fda60a1..99d8987 100644 --- a/imoo/__init__.py +++ b/imoo/__init__.py @@ -4,7 +4,7 @@ from flask import Flask from flask.ext.login import LoginManager from flask.ext.sqlalchemy import SQLAlchemy from flask_wtf.csrf import CsrfProtect -from migrate.versioning import api +import migrate.versioning.api as migrate_api from migrate.exceptions import DatabaseAlreadyControlledError # Login manager. @@ -22,13 +22,13 @@ def migrate_database(app): # If the DB isn't under version control yet, add the migrate_version table # at version 0 try: - api.version_control(db_uri, repo) + migrate_api.version_control(db_uri, repo) except DatabaseAlreadyControlledError: # we already own the DB pass # Apply all known migrations to bring the database schema up to date - api.upgrade(db_uri, repo, api.version(repo)) + migrate_api.upgrade(db_uri, repo, migrate_api.version(repo)) from imoo import views