def intents_to_string(intents, queryset=False):
    """
    Args:
        intents: [{"action": "/application/json/view"}, ...] OR
                    [models.Intent] (if queryset=True)
    Returns:
        ['<intent.action', ...]
    """
    if queryset:
        new_intents = [i.action for i in intents]
    else:
        new_intents = [i['action'] for i in intents]
    return str(sorted(new_intents))