I'm lazy! And I just want to store one single string value. That's all! Can I jump over any kind of Modeling and just store a value?
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- __call__() missing 1 required positional argument:
- Upload file to Google Cloud Storage using AngularJ
- Where is the best place to put one-time and every-
- facebook “could not retrieve data from URL”
相关文章
- Is there a size limit for HTTP response headers on
- appcfg.py command not found
- Google app engine datastore string encoding proble
- Angular route not working when used with Google Ap
- Doctrine not finding data on Google App Engine?
- Using OkHttp client via OKClient on Google App Eng
- Google appEngine: 404 when accessing /_ah/api [dup
-
Google App Engine Error:
INVALID_ARGUMENT
Depending on how long you want to store the information, you can also use memcache:
Import:
All you need to know to get and set data:
If your data needs long-term persistance, then you need to use the backend datastore. It is recommended to use both memcache and the datastore for your data, since the memcache can be flushed at any time. For short-term, ephemeral persistance, memcache does the trick.
More info here: http://code.google.com/appengine/docs/python/memcache/usingmemcache.html
Not as far as I know: the DataStore is the only storage available on App Engine. However, it's not a lot of code, even if you are lazy. ;)
Make sure you import the
db
module:Then just store a key/value pair (you can then use this model to store any other miscellaneous strings you might add as well):
You can get it again with:
Mark B's solution is good however you will get better performance if your "key" is the proper key of the entity. That way you halve the scans through the data required. (In SQL terms, you will be selecting by primary key.)
Now you can get and set using the class method.