summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-11-03 13:25:35 +0200
committerP. Christeas <p_christ@hol.gr>2010-11-03 13:25:35 +0200
commit1bfecf18279281c3fb0da00834237b4eb90fa7ea (patch)
tree7c12dc15966d102a83f19c8fcc4a89e1e248c1ad
parent169b716aa4541b2cdfd497de9e0bc2c70d38ba99 (diff)
caldav: implement the node_descriptor api.
Two commits ago, the webdav module started using this API instead of the get_data() one, so CalDAV must adapt now. bzr revid: p_christ@hol.gr-20101103112535-5cj7nnv75z8p0ew2
-rw-r--r--addons/caldav/caldav_node.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py
index b735d853025..978022fcbb5 100644
--- a/addons/caldav/caldav_node.py
+++ b/addons/caldav/caldav_node.py
@@ -21,7 +21,7 @@
import time
from document_webdav import nodes
-from document.nodes import _str2time
+from document.nodes import _str2time, nodefd_static
import logging
import StringIO
from orm_utils import get_last_modified
@@ -381,6 +381,9 @@ class node_calendar(nodes.node_class):
res.append(child._get_caldav_calendar_data(cr))
return res
+ def open_data(self, cr, mode):
+ return nodefd_static(self, cr, mode)
+
def _get_caldav_calendar_description(self, cr):
uid = self.context.uid
calendar_obj = self.context._dirobj.pool.get('basic.calendar')
@@ -458,14 +461,10 @@ class res_node_calendar(nodes.node_class):
self.model = res_model
self.res_id = res_id
- def open(self, cr, mode=False):
- if self.type in ('collection','database'):
- return False
- s = StringIO.StringIO(self.get_data(cr))
- s.name = self
- return s
+ def open_data(self, cr, mode):
+ return nodefd_static(self, cr, mode)
- def get_data(self, cr, fil_obj = None):
+ def get_data(self, cr, fil_obj=None):
uid = self.context.uid
calendar_obj = self.context._dirobj.pool.get('basic.calendar')
context = self.context.context.copy()