CORD-1252 add always_update_timestamp argument to ORM save function
Change-Id: I2bd1f5bf18a5467fa12fc93d53c31bcf819c0a5c
diff --git a/xos/xos_client/xosapi/orm.py b/xos/xos_client/xosapi/orm.py
index 202ecd8..119275c 100644
--- a/xos/xos_client/xosapi/orm.py
+++ b/xos/xos_client/xosapi/orm.py
@@ -223,7 +223,7 @@
self.reverse_cache.clear()
self.poisoned.clear()
- def save(self, update_fields=None):
+ def save(self, update_fields=None, always_update_timestamp=False):
if self.is_new:
new_class = self.stub.invoke("Create%s" % self._wrapped_class.__class__.__name__, self._wrapped_class)
self._wrapped_class = new_class
@@ -232,6 +232,8 @@
metadata = []
if update_fields:
metadata.append( ("update_fields", ",".join(update_fields)) )
+ if always_update_timestamp:
+ metadata.append( ("always_update_timestamp", "1") )
self.stub.invoke("Update%s" % self._wrapped_class.__class__.__name__, self._wrapped_class, metadata=metadata)
def delete(self):