def parse_relatedcontent_data(data):
    """
    Given encoded related content data form a hidden input field, parse it into
    a list of tuples (content_type, object_id).
    """
    final_data = []
    parts = [x.strip() for x in data.split(",") if x.strip()]
    for part in parts:
        data = part[1:-1].split(" ")
        content_type = data[0]
        object_id = data[1]
        final_data.append((data[0], data[1]))
    return final_data