def METHOD_NAME(self, analyze_repository):
    try:
        database = Database.objects.get(
            name=analyze_repository.database_name,
            databaseinfra__name=analyze_repository.databaseinfra_name
        )
    except Database.DoesNotExist:
        return analyze_repository.database_name
    else:
        return format_html(
            "<a href=/admin/logical/database/{}>{}</a>".format(
                database.id, database.name
            )
        )