Python gdata-2.0.4 - Entry object "has no email attribute", even when it does.

6 views
Skip to first unread message

John

unread,
Nov 6, 2009, 5:15:57 PM11/6/09
to Google Contacts API
I am fetching an Entry from Shared Contacts on a domain, and when I
try to access the email, I get " 'Entry' object has no attribute
'email' ".

Fetching via client.GetEntry( url ) I can access the name, contents,
etc. just not the email.

When I call Entry.ToString() I can see the email in there.

<?xml version='1.0' encoding='UTF-8'?>
<ns0:entry xmlns:ns0="http://www.w3.org/2005/Atom">
<ns0:content type="text">Notes here.</ns0:content>
<ns0:category scheme="http://schemas.google.com/g/2005#kind"
term="http://schemas.google.com/contact/2008#contact" />
<ns0:id>http://www.google.com/m8/feeds/contacts/example.com/base/
aaaaaaaaaaaaaaaa</ns0:id>
<ns0:link href="http://www.google.com/m8/feeds/photos/media/
example.com/aaaaaaaaaaaaaaaa" rel="http://schemas.google.com/contacts/
2008/rel#edit-photo" type="image/*" />
<ns0:link href="http://www.google.com/m8/feeds/contacts/example.com/
full/aaaaaaaaaaa" rel="self" type="application/atom+xml" />
<ns0:link href="http://www.google.com/m8/feeds/contacts/example.com/
full/aaaaaaaaaaaaaaa" rel="edit" type="application/atom+xml" />
<ns0:updated>2009-11-06T22:06:38.500Z</ns0:updated>
<ns0:title type="text">John Test 2</ns0:title>
<ns1:email address="jo...@example.com" primary="true" rel="http://
schemas.google.com/g/2005#work" xmlns:ns1="http://schemas.google.com/g/
2005" />
</ns0:entry>

If I get the Entry from client.GetContactsFeed( url ) I _can_ access
the email.

All of this is using the Python gdata-2.0.4 release.

Any hints would be appreciated, I'm new to Python and new to the API.

Thanks,

John

Julian (Google)

unread,
Nov 18, 2009, 11:18:48 AM11/18/09
to Google Contacts API
Hi John,

You should use client.GetContact( url ) instead, the GetEntry method
returns a more generic entry that does not have the contact details.

Cheers,
Julian

On Nov 6, 10:15 pm, John <j...@velvetcache.org> wrote:
> I am fetching anEntryfrom Shared Contacts on a domain, and when I
> try to access the email, I get " 'Entry'objecthas no attribute
> 'email' ".
>
> Fetching via client.GetEntry( url ) I can access the name, contents,
> etc. just not the email.
>
> When I callEntry.ToString() I can see the email in there.
>
> <?xml version='1.0' encoding='UTF-8'?>
>   <ns0:entryxmlns:ns0="http://www.w3.org/2005/Atom">
>   <ns0:content type="text">Notes here.</ns0:content>
>   <ns0:category scheme="http://schemas.google.com/g/2005#kind"
> term="http://schemas.google.com/contact/2008#contact" />
>   <ns0:id>http://www.google.com/m8/feeds/contacts/example.com/base/
> aaaaaaaaaaaaaaaa</ns0:id>
>   <ns0:link href="http://www.google.com/m8/feeds/photos/media/
> example.com/aaaaaaaaaaaaaaaa" rel="http://schemas.google.com/contacts/
> 2008/rel#edit-photo" type="image/*" />
>   <ns0:link href="http://www.google.com/m8/feeds/contacts/example.com/
> full/aaaaaaaaaaa" rel="self" type="application/atom+xml" />
>   <ns0:link href="http://www.google.com/m8/feeds/contacts/example.com/
> full/aaaaaaaaaaaaaaa" rel="edit" type="application/atom+xml" />
>   <ns0:updated>2009-11-06T22:06:38.500Z</ns0:updated>
>   <ns0:title type="text">John Test 2</ns0:title>
>   <ns1:email address="j...@example.com" primary="true" rel="http://
> schemas.google.com/g/2005#work" xmlns:ns1="http://schemas.google.com/g/
> 2005" />
> </ns0:entry>
>
> If I get theEntryfrom client.GetContactsFeed( url ) I _can_ access
> the email.
>
> All of this is using thePythongdata-2.0.4release.
>
> Any hints would be appreciated, I'm new toPythonand new to the API.
>
> Thanks,
>
> John
Reply all
Reply to author
Forward
0 new messages