summaryrefslogtreecommitdiff
path: root/addons/document/nodes.py
diff options
context:
space:
mode:
authorHarry (Open ERP) <hmo@tinyerp.com>2010-04-13 19:34:04 +0530
committerHarry (Open ERP) <hmo@tinyerp.com>2010-04-13 19:34:04 +0530
commita3dab7abb8a0a033827a0fc2bc3e1868544c83a8 (patch)
tree5a3d03281c865c859f51ad32a8b0043da75d2a1b /addons/document/nodes.py
parent6a94de909b027dc1259b3fc8b4d1cd16d1d2c467 (diff)
[IMP] caldav
bzr revid: hmo@tinyerp.com-20100413140404-bku8u3agsv79evyx
Diffstat (limited to 'addons/document/nodes.py')
-rw-r--r--addons/document/nodes.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/document/nodes.py b/addons/document/nodes.py
index 4957078c442..527fda3f594 100644
--- a/addons/document/nodes.py
+++ b/addons/document/nodes.py
@@ -289,6 +289,19 @@ class node_dir(node_database):
fnode = node_file(path,self,self.context,fil)
fnode.set_data(cr,data,fil)
return fnode
+
+ def get_etag(self, cr):
+ """ Get a tag, unique per object + modification.
+
+ see. http://tools.ietf.org/html/rfc2616#section-13.3.3 """
+ return self._get_ttag(cr) + ':' + self._get_wtag(cr)
+
+ def _get_wtag(self, cr):
+ """ Return the modification time as a unique, compact string """
+ if self.write_date:
+ wtime = time.mktime(time.strptime(self.write_date, '%Y-%m-%d %H:%M:%S'))
+ else: wtime = time.time()
+ return str(wtime)
def _get_ttag(self,cr):
return 'dir-%d' % self.dir_id