0
在Google App Engine中,我試圖獲取特定的記錄以及與其關聯的內容。我用下面的(相關)碼(所有必要的GData導入後,客戶端通過驗證):App Engine getRecord不返回內容
sclient = gdata.spreadsheet.text_db.DatabaseClient(username, password)
gdata.alt.appengine.run_on_appengine(sclient)
gdata.alt.appengine.run_on_appengine(sclient._GetDocsClient())
gdata.alt.appengine.run_on_appengine(sclient._GetSpreadsheetsClient())
ss = sclient.GetDatabases(spreadsheet_key="0AqKqcvXam_kcdFlfckZfVzRiaVpRelp2T1FsVl9rRHc")
processedSheet = ss[0].GetTables(worksheet_id=1)
targetTotals = processedSheet[0].GetRecord(row_number=1)
total1 = targetTotals.content["votea"]
的問題是在最後一行。它拋出這個錯誤:
AttributeError: 'NoneType' object has no attribute 'content'
我在對的GData的源代碼看上去的text_db試算表模塊和回線這樣說:
return Record(content=None, row_entry=row_feed.entry[0],
含義,通過設計函數不返回內容?這沒有太大意義。我使用了錯誤的功能嗎?我試圖完成的是獲得連續單元格的值。我的電子表格(processedSheet指的是)具有名爲「votea」,「voteb」等的列標題。第一行是整數。那麼,有什麼想法?
你確定google-app-engine是正確的標籤嗎?我沒有在這裏看到任何谷歌應用程序引擎的問題。 – systempuntoout 2010-12-06 07:58:19