You can write a function that does it def updateAttr(obj, **kwds): if obj is None: return for k,v in kwds.iteritems(): setattr(obj,k,v) ...... me = MyEnt.all().filter("index =", index).get() updateAttr(me, title = title, name=name, public=False)
2009/5/17 astrid.thuec...@googlemail.com <astrid.thuec...@googlemail.com>: > > When one creates a new entity one can give all the parameters to the > constructor: > > MyEnt(title=title, name=name, public=True, ...) > > But if I modify an entity already stored I need to write it in single > lines: > me = MyEnt.all().filter("index =", index).fetch(1)[0] > me.title = title > me.name=name > me.public=False > ... > > is there a shorter way to do this? > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---