Code Repositories xandikos / a67747f
Support calendar-multiget and calendar-query reports against schedule-inbox. Jelmer Vernooń≥ 2 years ago
2 changed file(s) with 10 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
224224
225225 class CalendarMultiGetReporter(davcommon.MultiGetReporter):
226226
227 name = '{urn:ietf:params:xml:ns:caldav}calendar-multiget'
228 resource_type = CALENDAR_RESOURCE_TYPE
227 name = '{%s}calendar-multiget' % NAMESPACE
228 resource_type = (CALENDAR_RESOURCE_TYPE, SCHEDULE_INBOX_RESOURCE_TYPE)
229229 data_property = CalendarDataProperty()
230230
231231
516516
517517 class CalendarQueryReporter(webdav.Reporter):
518518
519 name = '{urn:ietf:params:xml:ns:caldav}calendar-query'
520 resource_type = CALENDAR_RESOURCE_TYPE
519 name = '{%s}calendar-query' % NAMESPACE
520 resource_type = (CALENDAR_RESOURCE_TYPE, SCHEDULE_INBOX_RESOURCE_TYPE)
521521 data_property = CalendarDataProperty()
522522
523523 @webdav.multistatus
10221022 :param resource: Resource to check for
10231023 :return: boolean indicating whether this reporter is available
10241024 """
1025 return (self.resource_type is None or
1026 self.resource_type in resource.resource_types)
1025 if self.resource_type is None:
1026 return True
1027 if isinstance(self.resource_type, tuple):
1028 return any(rs in resource.resource_type
1029 for rs in self.resource_type)
1030 return self.resource_type in resource.resource_types
10271031
10281032 def report(self, environ, start_response, request_body, resources_by_hrefs,
10291033 properties, href, resource, depth):