how to set categories with python caldav

68 views Asked by At

How can I set/add categories on a existing calDAV-item? Change Summary works fine (first loop). On the category-loop comes an error.

all_events = my_calendar.events()

for event in all_events:
   event.load()
   if "xxxxx" in event.vobject_instance.vevent.summary.value:
       event.vobject_instance.vevent.summary.value="xxxxx cc" #this works
       event.save()
       event.load()
       print(event.data)
       
for event in all_events:
   event.load()
   if "xxxxx" in event.vobject_instance.vevent.summary.value:
       event.vobject_instance.vevent.categories= ["Test"] #ERROR while SAVE
       event.save()
       event.load()
       print(event.data)       

Error:
File "C:\Anaconda\Anaconda3\lib\site-packages\vobject\icalendar.py", line 976, in findTzids for child in obj.getChildren(): AttributeError: 'str' object has no attribute 'getChildren'

0

There are 0 answers