Example #1
0
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__)
Example #2
0
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__)
Example #3
0
def init_models(app):
    from ggrc.models.all_models import all_models  # noqa
    for model in all_models:
        inflector.register_inflections(model._inflector)
Example #4
0
def init_models(app):
  for model in all_models.all_models:
    inflector.register_inflections(model._inflector)
Example #5
0
def init_models(app):
  from ggrc.models.all_models import all_models  # noqa
  for model in all_models:
    inflector.register_inflections(model._inflector)
Example #6
0
def init_models(app):
    for model in all_models.all_models:
        inflector.register_inflections(model._inflector)