From 1bfecf18279281c3fb0da00834237b4eb90fa7ea Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Wed, 3 Nov 2010 13:25:35 +0200 Subject: [PATCH] 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 --- addons/caldav/caldav_node.py | 15 +++++++-------- 1 file 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()