carolinux / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 1 forks source link

Cannot read Organization from Contact by extending supplied contacts_example.py #621

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to read gdata.contacts.data.organization
2. It should be of the type gdata.data.organization and therefore have all the 
properties described in the module, e.g. name
3. When calling any properties of the object organization I always received an 
error that there is no such property.

But after some looking I found that it should behave way more like a list, e.g. 
like telephone numbers oder addresses.

So I went into the file gdata/contacts/data.py and editied in
class PersonEntry(gdata.data.BatchEntry)the entry
organization = gdata.data.Organization
into
organization = [gdata.data.Organization]

Since I am operating on class ContactEntry(PersonEntry):
I was not sure why this one had its own
organization = gdata.data.Organization
so I commented it out.
There might be reasons it does not use the one provided by PersonEntry so this 
might not be smart.

The result is that I can now iterate over a contacts organizations and read all 
properties like defined in gdata.data.Organization

Therefore I think the missing brackets were a bug and I suggest someone more 
knowledgable than me can correct this.

What version of the product are you using?
I am using gdata-2.0.17-py2.6.egg

Original issue reported on code.google.com by eulb...@prodyco.com on 16 Jun 2012 at 4:07