def get_related_models(model_instance):
    """
    Returns a list of all model classes this model has a relationship with
    Must be performed on a model instance rather than a model class - model instance fields will detect external model relationships.
    """
    related_models = []
    for field in model_instance._meta.get_fields():
        if field.related_model:
            related_models.append(field.related_model)
    return related_models
