google-code-export / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
1 stars 0 forks source link

Reminder failing to append to calendar event #567

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Using python script to create a new event, add attendee and add reminder. 
2. See code sample below
3.

What is the expected output? What do you see instead?
Expect to see the reminder details on the new event, however the reminder 
settings are empty (not set)

What version of the product are you using?
gdata-2.0.15
python 2.7

Please provide any additional information below.
Code Example:

import gdata.calendar
import gdata.calendar.service
import gdata.service
import atom
import atom.service
import time

client = gdata.calendar.service.CalendarService()
client.email = '...@gmail.com'
client.password = 'pwd'
client.ProgrammaticLogin()

event = gdata.calendar.CalendarEventEntry() 
event.timezone = gdata.calendar.Timezone(value='America/Chicago')
event.title = atom.Title(text='subject')
event.when.append(gdata.calendar.When(start_time='2011-11-20T11:00:00.000-06:00'
, end_time='2011-11-20T12:00:00.000-06:00'))
who = gdata.calendar.Who()
who.email = '...@gmail.com'
event.who.append(who)

remind = gdata.calendar.Reminder()
remind.minutes='60'
remind.method='email'
event.reminder.append(remind)

new_event = client.InsertEvent(event, 
'https://www.google.com/calendar/feeds/...%40gmail.com/private/full')

Original issue reported on code.google.com by StMarysC...@gmail.com on 18 Nov 2011 at 6:45

GoogleCodeExporter commented 9 years ago
Hello,

The reminder needs to be set under the when element:
  event.when[0].reminder.append(remind)

Also, version 1.0 and 2.0 of the Calendar API are being deprecated. I strongly 
advise that you switch to the new Google Calendar API v3:
  http://code.google.com/apis/calendar/v3/

Best,
Alain

Original comment by ala...@google.com on 18 Nov 2011 at 6:55