I am using Python Google calendars api
I want to add reminder in a recurrence event
sample code is below :
---------------------------------------------------------------------------------------------------------------------
event = gdata.calendar.CalendarEventEntry()
event.title = atom.Title(text='title')
event.content = atom.Content(text='content')
event.where.append(gdata.calendar.Where(value_string='where'))
recurrence_data = ('DTSTART;VALUE=DATE:20070501\r\n'
+ 'DTEND;VALUE=DATE:20070502\r\n'
+ 'RRULE:FREQ=WEEKLY;BYDAY=Tu;UNTIL=20070904\r\n')
event.recurrence = gdata.calendar.Recurrence(text=recurrence_data)
new_event = self.cal_client.InsertEvent(event, '/calendar/feeds/
default/private/full')
minutes = 30
for a_when in new_event.when:
if len(a_when.reminder) > 0:
a_when.reminder[0].minutes = minutes
else:
a_when.reminder.append(gdata.calendar.Reminder
(minutes=minutes))
print 'Adding %d minute reminder to event' % (minutes,)
return self.cal_client.UpdateEvent(new_event.GetEditLink().href,
event)
---------------------------------------------------------------------------------------------------------------------
When I check the calendar, no reminder is set.
new_event.when is empty so my program didn't enter the for loop
How can I resolve this problem??
thanks ^^
--
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en.