简体   繁体   中英

How to access lowlevel API for storing data in Google App Engine for python

What is the alternative for Entity.java in python version? I do not want any data model. I want my entities without a predefined structure. I just want them to be key and value pairs as the above Entity.java is.

Can I do it in Python version?

The 'low level' API is in google.appengine.api.datastore. There's no public documentation for it, but the module itself has fairly complete docstrings.

Try the Expando class.

class MyModel(db.Expando)
   pass

You can then add properties by simply setting the value. And they can be removed too.

edit: I should also have mentioned the dynamic properties method. It will return the list of properties defined for a particular entity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM