2

通過App Engine的Python中使用的GData日曆API,當你創建一個事件有方便的小輔助方法解析響應:解析來自InsertCalendar Python中的GAE(日曆API)原子反應

new_event = calendar_service.InsertEvent(event, '/calendar/feeds/default/private/full') 
helper = new_event.GetEditLink().href 

當你創建一個新的日曆:

new_calendar = gd_client.InsertCalendar(new_calendar=calendar) 

我想知道是否有可能與我只是不能在文檔中找到方法(或者是 - 也許 - 無證)?

我需要新的日曆的ID存儲在數據存儲,所以我想沿着線的東西:

new_calendar = gd_client.InsertCalendar(new_calendar=calendar) 
new_calendar.getGroupLink().href 

在我的代碼,正在創建日曆,和G是返回的Atom響應與201,但在我使用elementtree或atom.parse來提取所需的元素之前,我希望這裏有人能夠提供幫助。

提前:)

回答

0

非常感謝我從來沒有使用的GData API,所以我可能是錯的,但是...

看起來GetLink()將返回鏈接對象的任何指定的相對。看起來像GetEditLink()只是調用GetLink(),傳遞編輯鏈接的rel。因此,您應該能夠從InsertCalendar()的響應呼叫GetLink(),並傳遞組鏈接的rel。

下面是我用摸不着頭腦的是pydoc信息:http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.calendar_resource.data.html

+0

非常感謝你的回覆:) 不幸的是,似乎沒有工作。 最終做了什麼工作是: `new_calendar = gd_client.InsertCalendar(new_calendar = calendar) calendar_link = new_calendar.link [0] .href` – AllanKH 2011-03-27 18:36:16