예제 #1
0
def loadParameters(apps, schema_editor):
    from django.core.management.commands.loaddata import Command
    call_command(Command(),
                 "parameters.json",
                 app_label="odoo",
                 verbosity=0,
                 database=schema_editor.connection.alias)
예제 #2
0
def initialize(sender, **kwargs):
    """
    Initialize the amcat database by loading data, creating the admin account, and upgrading the db if needed
    """
    datafile = os.path.join(os.path.dirname(amcat.models.__file__),
                            "_initial_data.json")
    Command().run_from_argv(["manage", "loaddata", datafile])
    create_admin()
    amcates.ES().check_index()
예제 #3
0
파일: loaddata.py 프로젝트: edisona/amcat
def load_data(sender, **kwargs):
    datafile = os.path.join(os.path.dirname(amcat.models.__file__),
                            "initial_data.json")
    Command().run_from_argv(["manage", "loaddata", datafile])