Your error is because run
causes the query to be run, returning an iterator which you need to iterate over the results. It doesn't directly return an entity.
In your case you are trying to update the iterator itself and then call put()
which of course fails.
Even with a limit of 1, you need to iterate.
You should be using get
, however, you point out you get an error:
error: raise BadValueError('Property %s is required' % self.name) BadValueError: Property info is required
This is because you have changed a property in your model info
and added required=True
but you have some old data in the datastore that has no value for info
.
Your problem has a lot to do with trying/changing too many things at once without really understanding what is going on. I suggest you go back and read the docs on queries and their methods, and remove required=True
from your info
property in the model until such time as you can update all the entities so that info
has a value.