def backwards(page_or_revision, data):
    """Map from three-option tag_filtering to boolean and_filtering.

    If tag_filtering was "all" (include pages that match all topic tags),
    set and_filtering to True. Otherwise, set it to False. The backwards
    field state doesn't support the tag_filtering "none" case.
    """
    data["and_filtering"] = data.pop("tag_filtering", None) == "all"
    return data