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)
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()
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])