1

Looked through the documentation and can't work this out.

Is it possible to access the attribute of an entity retrieved from the datastore with a string in Python on GAE?

Something like employee.name but employee.<>

4

1 に答える 1

4

You can do something like this, if I understand you correctly:

getattr(MyModel, attrib_name) 

which will retrieve the attribute attrib_name

于 2012-11-01T11:32:31.400 に答える