I am following the fine article at
http://code.google.com/appengine/articles/update_schema.html
but have run into some difficulties as I am very new to this. I run
this on my development system and it works fine, but when I tried to
run it at appspot.com I get the error far below.
I have just taken the requestHandler given in the article and added it
to my map.py file? Below is my version of that requestHandler, which I
named "Update" as you can see. The only change I made in the
RequestHandler was to use my "date" field instead of the "name" field
as done in the example. And my model is named Pin, not Picture, but I
kept "pic" where the example used "pic", instead of my "pin".
*********************************************************************
# Request handler for the URL /update_datastore
class Update(webapp.RequestHandler):
def get(self):
name = self.request.get('date', None)
if name is None:
# First request, just get the first name out of the datastore.
pic = Pin.gql('ORDER BY name DESC').get()
name = pic.name
q = Pin.gql('WHERE name <= :1 ORDER BY name DESC', name)
pics = q.fetch(limit=2)
current_pic = pics[0]
if len(pics) == 2:
next_name = pics[1].name
next_url = '/update_datastore?date=%s' % urllib.quote
(next_name)
else:
next_name = 'FINISHED'
next_url = '/' # Finished processing, go back to main page.
# In this example, the default values of 0 for num_votes and
avg_rating are
# acceptable, so we don't need to do anything other than call put
().
current_pic.put()
context = {
'current_name': name,
'next_name': next_name,
'next_url': next_url,
}
self.response.out.write(template.render('update_datastore.html',
context))
*********************************************************************
I get the following error, where line 241 is this one above:
current_pic.put()
*********************************************************************
Traceback (most recent call last):
File "/base/python_lib/versions/1/google/appengine/ext/webapp/
__init__.py", line 498, in __call__
handler.get(*groups)
File "/base/data/home/apps/carpoolfinder/2.330773714346785160/
maps.py", line 241, in get
current_pic.put()
File "/base/python_lib/versions/1/google/appengine/ext/db/
__init__.py", line 657, in put
return datastore.Put(self._entity)
File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 162, in Put
raise _ToDatastoreError(err)
File "/base/python_lib/versions/1/google/appengine/api/
datastore.py", line 1637, in _ToDatastoreError
raise errors[err.application_error](err.error_detail)
Timeout: datastore timeout: operation took too long.
*********************************************************************
Can you please tell me what I am doing wrong?
Thank you,
Brian in Atlanta
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---