【发布时间】:2013-10-25 03:40:01
【问题描述】:
使用 GData Python 库,版本 2.0.18
尝试使用服务方法(而不是示例应用程序中的客户端)检索联系人列表。看起来返回被映射到一个 ContactEntry(好),但是当我尝试访问 name 属性时它给出了错误:
AttributeError: 'ContactEntry' 对象没有属性 'name'
from gdata.contacts.service import ContactsService
(...)
self.client = ContactsService(source='appname', additional_headers=additional_headers )
feed = self.client.GetContactsFeed(uri=query.ToUri())
self.client 是一个 gdata.contacts.service
GetContactsFeed 使用
def GetContactsFeed(self, uri=None):
uri = uri or self.GetFeedUri()
return self.Get(uri, converter=gdata.contacts.ContactsFeedFromString)
示例代码使用desired_class=gdata.contacts.data.ContactsFeed
似乎应该有一个名称属性。 我的语法错了吗?
【问题讨论】:
-
请提供Short, Self Contained, Correct, Example 和完整的回溯。
标签: python gdata gdata-api google-shared-contacts google-profiles-api