Will Welker
Will Welker

Reputation: 22

How To Use a Simple Datastore Variable

I have successfully run the guestbook tutorial in GAE but I am having a hard time understanding how to read and write to the Datastore. In my programming experience. int x = 5 etc. In the Guestbook tutorial, EVERYTHING is named guestbook_name. The variables, the values, the Datastore keys, all named guestbook_name or default_guestbook_name. I can't sort it out. It makes a new programmer's brain hurt! I am sure the answer is right there in the basic tutorial but every other word is guestbook_name How can I assign a value of 5 to a datastore object then make that value += 1 every time a certain URL is requested? An example of this (in Python) would help me understand how to store and manipulate data.

Upvotes: 0

Views: 320

Answers (3)

Sachin Kariyattin
Sachin Kariyattin

Reputation: 560

Guestbook tutorial has been a complex one to understand for many users. I suggest you to go through this video tutorial on datastore. Even though this tutorial is in java (not python as requested), It will help you to understand the concept of datastore better than Guestbook tutorial

GAE Datastore tutorial

Upvotes: 2

Ojonugwa Jude Ochalifu
Ojonugwa Jude Ochalifu

Reputation: 27237

Unless you want to change the values of the properties of an Entity "manually" from the Datastore viewer, "assigning a value of 5 to a datastore object" (which in this case means a property, for instance Number_of_Trips a Car Entity has taken in a car management app) will have to be done on the client side through URL requests. That said, there are a couple of example tutorials such as this and the documentation You really need to be patient though.

Upvotes: 1

Andrei Volgin
Andrei Volgin

Reputation: 41089

Guestbook tutorial is a good start, but you cannot learn a new language/platform from a simple application. I suggest that you read the documentation on how to use App Engine Datastore:

https://developers.google.com/appengine/docs/python/datastore/

It provides many useful examples and code samples.

Upvotes: 0

Related Questions