def add_control_lists(self): """ Loads a control list from a folder as a public one :param folder_name: Name of the folder in app/configurations/langs """ ControlLists.add_default_lists() db.session.commit()
def db_create(): """ Creates a local database """ with app.app_context(): db.create_all() Role.add_default_roles() User.add_default_users() ControlLists.add_default_lists() db.session.commit() click.echo("Created the database")
def db_recreate(): """ Recreates a local database. You probably should not use this on production. """ with app.app_context(): db.drop_all() db.create_all() Role.add_default_roles() User.add_default_users() ControlLists.add_default_lists() db.session.commit() click.echo("Dropped then recreated the database")