访问单元格历史记录(python,智能表)

Accessing Cell history (python, smartsheets)

我正在寻找一种访问单元格历史元素的方法。我已经使用以下代码的各种迭代来获取单元格历史字典中的键,但我(显然)做错了什么。当 运行 如下代码时,我收到此错误 - TypeError: 'CellHistory' object has no attribute '__getitem__'

求助!这让我发疯!

#get the cell history
action = smartsheet.Cells.get_cell_history(
    sheetid,
    sheet.rows[1].id,
    columns[1].id,
    include_all=True)

 revisions = action.data

#print out something from revision history
for rev in revisions:
    print rev['modifiedAt'] #breaks here`

您似乎在 print 语句中使用了错误的属性名称和语法。尝试这样的事情:

#print out revision history
for rev in revisions:
    print(rev.modified_at)
    print(rev.modified_by.name)
    print('')