Google日历扩展属性可以是列表吗?

2024-09-28 03:19:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我想向Google日历事件添加一组extendedProperties。我希望这些属性中的一些是列表。As(在python中)

event = {
         ..., # standard properties
         "extendedProperties": {
                "shared": {
                    "max_crew": 3,
                    "crew_list": [
                        "crew1@example.com",
                        "crew2@example.com",
                        ],
                }
            }
           ...
         }

这将创建max_crew属性,而不是crew_list属性。在

有办法吗?还是需要使用可解析字符串(最多1024个字符)?在


Tags: comevent列表属性exampleasgoogle事件
2条回答

有一种方法:explained in Google Calendar's guide和{a2}。在

在Python中,首先为您的额外字段创建一个字典。
body = { "extendedProperties": { "private": { "petsAllowed": "yes" } } }

然后用:
service.events().patch(calendarId='calendar_id', eventId='event_id', body=body).execute()

如果成功,它将返回更新的事件。在

Hybor证实了我的观察:接口不支持列表作为值。目光短浅,伊荷,但事实的确如此。在

相关问题 更多 >

    热门问题