views:

36

answers:

2

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?

+1  A: 

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.

Robert Kluin
It seems working. But Expando extends Model. Is there anything lower than Model that I can access?
Rajesh
If you want something lower level see Nick's reply. Check out Tim's reply to this (http://groups.google.com/group/google-appengine-python/browse_thread/thread/a54bd7146045971/90a9f4f442665033) thread. He gives an example of how you can directly access datastore objects as dictionaries.
Robert Kluin
+5  A: 

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.

Nick Johnson