示例#1
0
 def setUp(self):
     self.config = testing.setUp()
     from sqlalchemy import create_engine
     engine = create_engine('sqlite://')
     from babytracker.models import DBSession, Base
     DBSession.configure(bind=engine)
     Base.metadata.create_all(engine)
示例#2
0
def setup_database(settings):
    if 'DATABASE_URL' in os.environ:  # Used on Heroku
        settings['sqlalchemy.url'] = os.environ['DATABASE_URL']

    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)

    Base.metadata.create_all(engine)
示例#3
0
def setup_database(settings):
    if 'DATABASE_URL' in os.environ: # Used on Heroku
        settings['sqlalchemy.url'] = os.environ['DATABASE_URL']

    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)

    Base.metadata.create_all(engine)
示例#4
0
    def setUp(self):
        self.config = testing.setUp()
        from sqlalchemy import create_engine

        engine = create_engine("sqlite://")
        from babytracker.models import DBSession, Base

        DBSession.configure(bind=engine)
        Base.metadata.create_all(engine)