【问题标题】:Using python O365: How to retrieve more than 25 entries when getting calendar events?使用 python O365:获取日历事件时如何检索超过 25 个条目?
【发布时间】:2020-05-26 21:49:27
【问题描述】:

我使用以下代码检索日历条目:

from O365 import Account    
# get account element for calendars
schedule = account.schedule()
# get the main calendar
calendar = schedule.get_default_calendar()
# make a query that gets all events between a certain start and end date
begin = datetime.date.today()
end = begin + datetime.timedelta(days = 14)
query = calendar.new_query("start").greater_equal(begin)
query.chain('and').on_attribute('end').less_equal(end) 
# add all events to a variable
myEvents = calendar.get_events(query=query, include_recurring=True)

问题是我从“get_events”获得最多 25 个条目。

我一般如何处理此类问题?我试图在 O365 的 github repo 上找到答案,但他们似乎没有进一步详细说明库中存在哪些函数以及各自的参数是什么。他们只是列举例子。

【问题讨论】:

    标签: python azure calendar azure-ad-graph-api outlook-restapi


    【解决方案1】:

    根据此处的文档:https://o365.github.io/python-o365/latest/html/api/calendar.html#O365.calendar.Calendar.get_events

    您可以使用 limit 参数将其增加到 999。 类似 get_events(limit=500, *, query=None, order_by=None, batch=None, download_attachments=False)

    希望这对您有所帮助。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-15
    • 2011-12-17
    • 1970-01-01
    • 1970-01-01
    • 2021-05-06
    • 2013-08-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多