コード例 #1
0
ファイル: dbutils.py プロジェクト: nlyubchich/Meowth
def populate(directory=None):
    """ Populate database with fixtures
    """

    if directory is None:
        directory = current_app.config['FIXTURES_DIR']
    with perform(
            name='dbutils populate',
            before='Loading fixtures from directory %s' % directory,
            fail='Error occured while loading fixtures',
    ):
        load_fixtures(directory)
コード例 #2
0
ファイル: dbutils.py プロジェクト: saklar13/Meowth
def populate(directory=None):
    """ Populate database with fixtures
    """

    if directory is None:
        directory = current_app.config['FIXTURES_DIR']
    with perform(
        name='dbutils populate',
        before='Loading fixtures from directory %s' % directory,
        fail='Error occured while loading fixtures',
    ):
        load_fixtures(directory)
コード例 #3
0
ファイル: utils.py プロジェクト: uaprom-summer-2015/Meowth
 def create_app(self):
     self.app = app_factory()
     with self.app.app_context():
         db.create_all()
         load_fixtures(self.app.config["FIXTURES_DIR"])
     return self.app
コード例 #4
0
 def create_app(self):
     self.app = app_factory()
     with self.app.app_context():
         db.create_all()
         load_fixtures(self.app.config['FIXTURES_DIR'])
     return self.app