1) When a script gets data from the database using the db.Model.get_element_by_id(“id”) method, what id does it refer to, and how can you get it from the database.
2) If you get a result using this method, does that result maintain a link to the database so that any changes to the result are reflected on the database? If not, how would you update an entry in the database?
1) When a script gets data from the database using the db.Model.get_element_by_id(id) method, what
Share
As Jonathan Feinberg suggested, this is answered in the Google App Engine tutorial. The relevant piece of the tutorial is found here: http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html
On that page, this text specifically answers your question about “how would you update an entry in the database:
The explanation for keys and such is found on this documentation page: http://code.google.com/appengine/docs/python/datastore/keysandentitygroups.html
And as a final suggestion, don’t worry about things like “maintaining a connection to the database”. The entire premise of the Google App Engine is that they have abstracted away things like connection management, and such, so that you can benefit from the inherent scalability of the platform. Sticking to the documentation and learning about the libraries and frameworks that are available will be the best route to success.