Hello, 2011-01-27 15:24:50 "Adi J. Sieker" <adi sieker info>: >On 23/01/11 20:04, Karol Be;dkowski wrote: >> So, if you replace GoogleContact(EmailContact) with >> GoogleContact(Leaf) this brake whole grouping for contacts from >> gmail (this leaves can't (shouldn't) be grouped). >> >I did replace GoogleContact(EmailContact) with GoogleContact(Leaf). As I said, drop EmailContact as a superclass for GoogleContact break whole grouping for this leaves, so you shouldn't do this. >What I now do is I use the EmailContact with the email and as the name >Is pass the label from google i.e. 'Home email' or 'Work email'. This >means I have around a 100 or so EmailContact instances which have the >grouped_slots NAME set to 'Work email'. For keeping email, this should work ok: EMAIL_TYPE_KEY = "KEY_EMAIL_TYPE" class GoogleContact(EmailContact): def __init__(self, email, name, image, email_type): EmailContact.__init__(self, email, name) self.image = image self.object[EMAIL_TYPE_KEY] = email def get_description(self): return '%s: %s' % (self.object[EMAIL_TYPE_KEY], self.object[EMAIL_KEY]) Of course, for grouping all leaves for particular contacts all leaves should have the same "name". Maybe type of email should be added directly to the EmailContact class. > From your explanation I would expect to have a Leaf in my index > called 'Work email' which I can navigate into have all the work > emails of my contacts listed. This is not the case. If I activate > kupfer and type work email I just get a the option to large type the > text. After this, you should have one leaf for each contact "name". When some contact have two or more addresses, they will be visible as sub-leaves. >> class ContactDetails (ContactLeaf): >> [...] >> And use this to keep additional information (yield this objects in >> source). I check this for simple example and seems to work ok. Of >> course this class may be extended or maybe there should be separate >> class for phones, addresses etc. >This is basically what I have been thinking of doing, wafter reading >your mail. I thinking about this and I almost sure, that we should have something like: PhoneContact(ContactLeaf) - for all home/fax/work phone numbers SmailContact(ContactLeaf) - for work/home/other addresses IMContact(ContactLeaf) - for IM contacts, but for existing (Jabber, Skype) you should use already created classes. Regards, Karol
Attachment:
signature.asc
Description: PGP signature