-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some feature enhancements #3
Comments
Hi Tarek, Thank you for using the package and for taking the time to write to me. I was also considering adding row ID's to the results in order to simplify Yoav On Wed, Jul 11, 2012 at 2:21 AM, gekkoman <
|
Yoav, my app is async......I have the row ID printed on paper and at some time later update the record using the row ID as the key. As such i need to retrieve a single entry from Google based on its row ID and update it, without any preloaded entries in the cache. The private method "_get_row_entry_by_id" in your better_row_id code does this. i.e. if you call this function with any empty cache you will get the record required. I like the fact that you populate a cache so one can do things locally, and the simplicity of the process. I was going the same way because I was finding the google API to be not the most user friendly thing out there. To me the ideal API solution would be one more level of abstraction from current, that is we do operations at row level. eg rows=sheet.get_rows(query) #returns a list of row objects row.update() #update single row if necessary singlerow=sheet.get_row(id) This way you don't have to keep track of indexes, keys etc at all for doing updates. You could also do inserts/deletes etc in this way n=sheet.row() This is however more complex and breaks the current API completely. Tarek |
Yoav,
thanks for your package. I was half way writing basically the same when I stumbled on yours which saved me a bit of time.
I however needed some more functionality which you may wish to implement in your package.
My application requires unique row identification for later retrieval.
Sorting through the whole listfeed seemed grossly inefficient, so I am using the following as workaround.
identification:
sheet=api.get_worksheet(spreadsheet, worksheet)
rows = sheet.get_rows()
for i, row in enumerate(rows):
id = sheet._get_row_entries(sheet.query)[i].id.text.rsplit("/",1)[1] #NAUGHTY!
retrieval:
rowkey='4su05' #unique row key
sheet=api.get_worksheet(spreadsheet, worksheet)
fudge to get single row only
sheet.keys['row_id']=rowkey #NAUGHTY!
sheet.entries=[sheet.gd_client.GetListFeed(**sheet.keys)] #NAUGHTY!
rows=sheet.get_rows()
Now you can update etc as intended
Regards
Tarek
The text was updated successfully, but these errors were encountered: