def register_model(model): """Add model to all models. This function is used for adding models from different ggrc modules, such as ggrc_workflows or ggrc_risks, to the list of all models in the ggrc module. Args: model: sqlalchemy model to be added to the list of all models. """ current_module = sys.modules[__name__] setattr(current_module, model.__name__, model) inflector.register_inflections(model._inflector) all_models.append(model) __all__.append(model.__name__)
def register_model(model): """Add model to all models. This function is used for adding models from different ggrc modules, such as ggrc_workflows or ggrc_risks, to the list of all models in the ggrc module. Args: model: sqlalchemy model to be added to the list of all models. """ current_module = sys.modules[__name__] setattr(current_module, model.__name__, model) inflector.register_inflections(model._inflector) all_models.append(model) __all__.append(model.__name__)
def init_models(app): from ggrc.models.all_models import all_models # noqa for model in all_models: inflector.register_inflections(model._inflector)
def init_models(app): for model in all_models.all_models: inflector.register_inflections(model._inflector)
def init_models(app): from ggrc.models.all_models import all_models # noqa for model in all_models: inflector.register_inflections(model._inflector)
def init_models(app): for model in all_models.all_models: inflector.register_inflections(model._inflector)