app/soc/logic/models/base.py
changeset 2736 8f3935f0f4ba
parent 2709 7a595f688ab5
child 2756 054810192277
--- a/app/soc/logic/models/base.py	Fri Aug 07 01:00:58 2009 +0200
+++ b/app/soc/logic/models/base.py	Fri Aug 07 01:27:24 2009 +0200
@@ -378,7 +378,8 @@
 
     return query
 
-  def updateEntityProperties(self, entity, entity_properties, silent=False):
+  def updateEntityProperties(self, entity, entity_properties, silent=False,
+                             store=True):
     """Update existing entity using supplied properties.
 
     Args:
@@ -386,6 +387,7 @@
       entity_properties: keyword arguments that correspond to entity
         properties and their values
       silent: iff True does not call _onUpdate method
+      store: iff True updated entity is actually stored in the data model
 
     Returns:
       The original entity with any supplied properties changed.
@@ -408,7 +410,8 @@
         value = entity_properties[name]
         prop.__set__(entity, value)
 
-    entity.put()
+    if store:
+      entity.put()
 
     # call the _onUpdate method
     if not silent: