def get_included_models(model):
    """
    get a list of all models stored within a model
    (including the owning model).

    Args:
        model: the owning model

    Returns:
        a list of all models
    """
    if (hasattr(model, "_tx_model_repository")):
        models = list(model._tx_model_repository.all_models)
        if model not in models:
            models.append(model)
    else:
        models = [model]
    return models