Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 3
0
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])