(case, case_property_name, start=0, per_page=50)
return infos, last_index
Return paged changes to case properties, and last transaction index checked
Return paged changes to case properties, and last transaction index checked
Return paged changes to case properties and last transaction index checked
def get_paged_changes_to_case_property(case, case_property_name, start=0, per_page=50):
    """Return paged changes to case properties, and last transaction index checked
    """

    def iter_transactions(transactions):
        for i, transaction in enumerate(transactions):
            property_changed_info = property_changed_in_action(
                case.domain,
                transaction,
                case.case_id,
                case_property_name
            )
            if property_changed_info:
                yield property_changed_info, i + start

    num_actions = len(case.actions)
    if start > num_actions:
        return [], -1

    case_transactions = iter_transactions(
        sorted(case.actions, key=lambda t: t.server_date, reverse=True)[start:]
    )

    infos = []
    last_index = 0
    while len(infos) < per_page:
        try:
            info, last_index = next(case_transactions)
            infos.append(info)
        except StopIteration:
            last_index = -1
            break

    return infos, last_index
def get_paged_changes_to_case_property ( case , case_property_name , start = 0 , per_page = 50 ) : def iter_transactions ( transactions ) : for i , transaction in enumerate ( transactions ) : property_changed_info = property_changed_in_action ( case . domain , transaction , case . case_id , case_property_name ) if property_changed_info : yield property_changed_info , i + start num_actions = len ( case . actions ) if start > num_actions : return [ ] , - 1 case_transactions = iter_transactions ( sorted ( case . actions , key = lambda t : t . server_date , reverse = True ) [ start : ] ) infos = [ ] last_index = 0 while len ( infos ) < per_page : try : info , last_index = next ( case_transactions ) infos . append ( info ) except StopIteration : last_index = - 1 break return infos , last_index