Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'Exchange2010CalendarEventList' object is not iterable #54

Open
nlamirault opened this issue Jul 10, 2015 · 1 comment
Open

Comments

@nlamirault
Copy link

I can retrieve all my events from calendar (like this [1]) but objet is not iterable :

events = cal.list_events(start, end, details=True)
print("Events: %s" % events)
for event in events:
     print "{start} {stop} - {subject}".format(
        start=event.start,
        stop=event.end,
        subject=event.subject
    )

I've got this error :

TypeError: 'Exchange2010CalendarEventList' object is not iterable

I'm using v0.6

[1] : https://pyexchange.readthedocs.org/en/latest/#listing-events

@nlamirault
Copy link
Author

Checking unit tests, i find my error. It works now :

events = cal.list_events(start, end, details=True)
for event in events.events:
   print "{start} {stop} - {subject}".format(
        start=event.start,
        stop=event.end,
        subject=event.subject
    )

You should update documentation like this :

events = my_calendar.list_events(
    start=timezone("US/Eastern").localize(datetime(2014, 10, 1, 11, 0, 0)),
    end=timezone("US/Eastern").localize(datetime(2014, 10, 29, 11, 0, 0)),
    details=True
)

for event in events.events:
    print "{start} {stop} - {subject}".format(
        start=event.start,
        stop=event.end,
        subject=event.subject
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant