def should_sync(data, last_sync):
    """
    Determine if a data collection needs to be synced.
    """

    # definitely sync if we haven't synced before
    if not last_sync or not last_sync.date:
        return True

    # check if any items have been modified since last sync
    for data_item in data:
        # >= used because if they are the same second, who knows
        # which actually happened first
        if not data_item.last_modified or data_item.last_modified >= last_sync.date:
            return True

    return False