Skip to content

Commit cae6e2d

Browse files
committed
some more documentation, trying to make it more visible that a CalendarObjectResource (event) should contain one calendar component except for recurrences where it may contain overridden instances
1 parent 20a757e commit cae6e2d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

caldav/calendarobjectresource.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,17 @@
7979

8080

8181
class CalendarObjectResource(DAVObject):
82-
"""
83-
Ref RFC 4791, section 4.1, a "Calendar Object Resource" can be an
82+
"""Ref RFC 4791, section 4.1, a "Calendar Object Resource" can be an
8483
event, a todo-item, a journal entry, or a free/busy entry
84+
85+
As per the RFC, a CalendarObjectResource can at most contain one
86+
calendar component, with the exception of recurrence components.
87+
Meaning that event.data typically contains one VCALENDAR with one
88+
VEVENT and possibly one VTIMEZONE.
89+
90+
In the case of expanded calendar date searches, each recurrence
91+
will (by default) wrapped in a distinct CalendarObjectResource
92+
object. This is a deviation from the definition given in the RFC.
8593
"""
8694

8795
## There is also STARTTOFINISH, STARTTOSTART and FINISHTOFINISH in RFC9253,
@@ -473,7 +481,7 @@ def _set_icalendar_component(self, value) -> None:
473481
icalendar_component = property(
474482
_get_icalendar_component,
475483
_set_icalendar_component,
476-
doc="icalendar component - should not be used with recurrence sets",
484+
doc="icalendar component - this is the simplest way to access the event/task - it will give you the first component that isn't a timezone component. For recurrence sets, the master component will be returned. For any non-recurring event/task/journal, there should be only one calendar component in the object. For results from an expanded search, there should be only one calendar component in the object",
477485
)
478486

479487
component = icalendar_component

0 commit comments

Comments
 (0)