def get_record_changes(del_rrest, add_rrest):
    changeSet = []
    delSet = (del_rrest['records'] if ('records' in del_rrest) else [])
    addSet = (add_rrest['records'] if ('records' in add_rrest) else [])
    for d in delSet:
        exists = False
        for a in addSet:
            if (d['content'] == a['content']):
                exists = True
                if (d['disabled'] != a['disabled']):
                    changeSet.append(({'disabled': d['disabled'], 'content': d['content']}, {'disabled': a['disabled'], 'content': a['content']}, 'status'))
                break
        if (not exists):
            changeSet.append(({'disabled': d['disabled'], 'content': d['content']}, None, 'deletion'))
    for a in addSet:
        exists = False
        for d in delSet:
            if (d['content'] == a['content']):
                exists = True
                break
        if (not exists):
            changeSet.append((None, {'disabled': a['disabled'], 'content': a['content']}, 'addition'))
            continue
    for a in addSet:
        exists = False
        for c in changeSet:
            if ((c[1] != None) and (c[1]['content'] == a['content'])):
                exists = True
                break
        if (not exists):
            changeSet.append(({'disabled': a['disabled'], 'content': a['content']}, {'disabled': a['disabled'], 'content': a['content']}, 'unchanged'))
    return changeSet
def get_record_changes(del_rrest, add_rrest):
    changeSet = []
    delSet = (del_rrest['records'] if ('records' in del_rrest) else [])
    addSet = (add_rrest['records'] if ('records' in add_rrest) else [])
    for d in delSet:
        exists = False
        for a in addSet:
            if (d['content'] == a['content']):
                exists = True
                if (d['disabled'] != a['disabled']):
                    changeSet.append(({'disabled': d['disabled'], 'content': d['content']}, {'disabled': a['disabled'], 'content': a['content']}, 'status'))
                break
        if (not exists):
            changeSet.append(({'disabled': d['disabled'], 'content': d['content']}, None, 'deletion'))
    for a in addSet:
        exists = False
        for d in delSet:
            if (d['content'] == a['content']):
                exists = True
                break
        if (not exists):
            changeSet.append((None, {'disabled': a['disabled'], 'content': a['content']}, 'addition'))
            continue
    for a in addSet:
        exists = False
        for c in changeSet:
            if ((c[1] != None) and (c[1]['content'] == a['content'])):
                exists = True
                break
        if (not exists):
            changeSet.append(({'disabled': a['disabled'], 'content': a['content']}, {'disabled': a['disabled'], 'content': a['content']}, 'unchanged'))
    return changeSet