Reputation: 1382
class Personel(db.Model):
ismarried=db.StringProperty()
class AddPersonal(webapp.RequestHandler):
def get(self):
per=Personal()
#i want use a function at below, instead of per.ismarried
per.whatisthisfunction("ismarried")="yes"
per.put
I want convert string to entity's property. Can it possible as above.
Upvotes: 1
Views: 50
Reputation: 16327
What you're looking for is setattr
:
setattr(per, "ismarried", "yes")
Upvotes: 3