コード例 #1
0
ファイル: all_models.py プロジェクト: k-alexey/ggrc-core
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__)
コード例 #2
0
ファイル: all_models.py プロジェクト: egorhm/ggrc-core
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__)
コード例 #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)
コード例 #4
0
ファイル: __init__.py プロジェクト: egorhm/ggrc-core
def init_models(app):
  for model in all_models.all_models:
    inflector.register_inflections(model._inflector)
コード例 #5
0
ファイル: __init__.py プロジェクト: Smotko/ggrc-core
def init_models(app):
  from ggrc.models.all_models import all_models  # noqa
  for model in all_models:
    inflector.register_inflections(model._inflector)
コード例 #6
0
def init_models(app):
    for model in all_models.all_models:
        inflector.register_inflections(model._inflector)