2

I am using Python's library: CalDav in order to connect Horde Calendar.

I have no trouble with creating a new event, however, I can't find in the documentation method how to update existing event.

Sagar P. Ghagare
  • 542
  • 2
  • 12
  • 25
RandomUser
  • 63
  • 1
  • 8

1 Answers1

0

Assuming the library you are using is this one: https://pythonhosted.org/caldav/.

To update an event you: - retrieve or create the event you want to modify - modify whatever you need to modify (but leave the UID unchanged) - call save()

See below an example from the library's test (see https://pythonhosted.org/caldav/#more-examples) - it creates an event starting in 2016, changes it to start in 2017 and calls save() to update the event on the CalDAV server:

def testDateSearchAndFreeBusy(self):
    [..]
    ## Create calendar, add event ...
    c = self.principal.make_calendar(name="Yep", cal_id=testcal_id)
    assert_not_equal(c.url, None)

    e = c.add_event(ev1)
    [..]
    ## ev2 is same UID, but one year ahead.
    # The timestamp should change.
    e.data = ev2
    e.save()
diciu
  • 29,133
  • 4
  • 51
  • 68