e_tag Property

Identifier returned by the CalDAV server which is used to synchronize edits.

Syntax

def get_e_tag() -> str: ...
def set_e_tag(value: str) -> None: ...

e_tag = property(get_e_tag, set_e_tag)

Default Value

""

Remarks

This property identifies the state of the event in the calendar. An ETag is returned by the CalDAV server after a successful put_calendar_event request. Every time an event is updated, the ETag changes. This gives you the ability to determine if another user has changed the event you added.

You can use this ETag value to maintain a cache. If you submit a get_calendar_report request with the report_filter_return_calendar_data property set to False only the URI and ETags for each event in the calendar will be returned in the report. You can cache the ETag and URI locally, and then inspect the report for any changes and update only the events that have changed ETags.

When updating an event with the put_calendar_event method, you may add the ETag to the "If-Match" header (using other_headers) in order to insure that you are not overwriting more recent changes on the server. For instance:

  calDAV.UID = "20110202T000000Z-6414-500-10112-204@nsoftest";
  calDAV.StartDate = "20110202T000000Z";
  calDAV.EndDate = "20110202T110000Z";
  calDAV.TimeStamp = "20100301T000000Z";
  calDAV.Summary = "Dinner with friends";
  calDAV.Description = "Getting everyone together for some food and fun";
  calDAV.Location = "The James Joyce Irish Pub";
  calDAV.EventType = CaldavsEventTypes.vEvent;
  calDAV.OtherHeaders = "If-Match: 1900-1900\r\ n";
  calDAV.PutCalendarEvent "https://caldav.calendar.yahoo.com/dav/user_name/Calendar/My_Calendar/20110202T000000Z-6414-500-10112-204@nsoftest.ics"
If the current ETag for the above event is "1900-1900", then the above modification will work perfectly. However, if the event was modified on the Yahoo server, the ETag will not match and the above will fail with an HTTP Protocol error: "409 Conflict". In that case you should retrieve the event with get_calendar_event and update the most recent version.

This property is filled from the response to a get_calendar_event, and is also used when creating an event to be added using the put_calendar_event method. However, when requesting a report using the get_calendar_report method, the contents of this property will only be valid inside the on_event_details event.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]