Hi,
To retrieve all events from a calendar -
def getAllEvents():
username = '[EMAIL PROTECTED]'
visibility = 'private'
projection = 'full'
query = gdata.calendar.service.CalendarEventQuery(username, visibility,
projection)
query.max_results = 50
feed = calendar_service.CalendarQuery(query)
for i, an_event in enumerate(feed.entry):
print 'Title: %s' % (an_event.title.text,)
print 'Location: %s' % (an_event.where[0].value_string,)
print 'Content: %s' % (an_event.content.text,)
print ''
when = an_event.when
print when[0].start_time
Hope that helps,
Austin
On Mon, Aug 25, 2008 at 11:34 PM, srikanth m <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> I Just tried to update an event to My Own Google Calendars
> using python. But, atleast events are not retrieving . It shows some
> attribute error.
>
> the code as follows :
>
>
> feed = self.cal_client.GetOwnCalendarsFeed()
> print '\nEvents on Primary Calendar: %s \n' % (feed.title.text,)
> for i, an_event in zip(xrange(len(feed.entry)), feed.entry):
> print '\n\t%s. %s \n' % (i, an_event.title.text,)
> for p, a_participant in zip(xrange(len(an_event.who)),
> an_event.who):
> print '\t\t%s. %s' % (p, a_participant.email,)
> print '\t\t\t%s' % (a_participant.name,)
>
> In the above code feed is to get the feeds from Own Calendars.
>
> It shown the error as follows :
>
>
> Traceback (most recent call last):
> File "C:\Python25\gdata.py-1.1.1\samples\calendar
> \Retieve_bothEvents.py", line
> 105, in <module>
> main()
> File "C:\Python25\gdata.py-1.1.1\samples\calendar
> \Retieve_bothEvents.py", line
> 102, in main
> sample.Run(delete)
> File "C:\Python25\gdata.py-1.1.1\samples\calendar
> \Retieve_bothEvents.py", line
> 67, in Run
> self._PrintAllEventsOnDefaultCalendar()
> File "C:\Python25\gdata.py-1.1.1\samples\calendar
> \Retieve_bothEvents.py", line
> 51, in _PrintAllEventsOnDefaultCalendar
> for p, a_participant in zip(xrange(len(an_event.who)),
> an_event.who):
> AttributeError: 'CalendarListEntry' object has no attribute 'who'
>
> How to retrive events and how to perform update event to both Own
> calendars.
>
>
> Best regards,
> Srikanth M
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---