Take the 2-minute tour ×

In Google App Engine, I am trying to get a specific record and the content associated with it. I use the following (relevant) code (all necessary GData is imported and the client is authenticated):

sclient = gdata.spreadsheet.text_db.DatabaseClient(username, password)

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"]

The problem is in the last line. It throws this error:

AttributeError: 'NoneType' object has no attribute 'content'

I looked in the source code for the GData spreadsheets text_db module and the return line says this:

return Record(content=None, row_entry=row_feed.entry[0],

Meaning that the function by design doesn't return the content? That doesn't make too much sense. Am I using the wrong function. What I'm trying to accomplish is to get the value of the cells in a row. My spreadsheet (that processedSheet is referring to) has column headers called "votea", "voteb", etc. The first row is integers. So, any ideas?

share|improve this question
Are you sure that google-app-engine is the proper tag? I don't see any google-app-engine question here. –  systempuntoout Dec 6 '10 at 7:58
He is running his app on App Engine, as you can see from the first few lines (run_on_appengine). –  Tom van Enckevort Dec 6 '10 at 11:41
The content should be read in the init method of the Record class. If content is None, it will call the ExtractContentFromEntry method which initializes the content property. Just have a look in the same text_db module you were already looking at. –  Tom van Enckevort Dec 6 '10 at 11:50
So how can I call the ExtractContentFromEntry in the code that I'm using? –  rhefner1 Dec 6 '10 at 21:44
add comment

1 Answer

up vote 0 down vote accepted

make sure you don't have any empty rows in spreadsheet. API will stop reading data when it encounters first empty line, so if your first row in spreadsheet is empty, you wont get any results.

share|improve this answer
add comment

Your Answer


