import inspect


def get_model_name(instance):
    """
    Converts a `Model` instance or `class` to a model name.

    :param instance:
        A `Model` instance or `class`.
    :return:
        The stringified model name in the form `{app label}.{model name}`.
    """
    return '{}.{}'.format(
        instance._meta.app_label,
        instance.__name__ if inspect.isclass(instance) else instance.__class__.__name__)