[Vobject] How to access multiple 'tel' in a vcard individually

Coert Klaver coert.klaver at planet.nl
Mon Dec 14 13:42:33 CST 2009


Hi,

I'm new to vobject, and run into a problem:
I want to have multiple telephone numbers in one object, but I don't 
know how to acces them seperately
Below, the first 'tel' is easy, but now I've added a second, but how 
to access this one?

 >>> import vobject
 >>> j=vobject.vCard()
 >>> j.add('tel')
<TEL{}>
 >>> j
<VCARD| [<TEL{}>]>
 >>> j.tel.value="0123456789"
 >>> j.tel.type_param = 'CELL'
 >>> j
<VCARD| [<TEL{'TYPE': ['CELL']}0123456789>]>
 >>> j.add('tel')
<TEL{}>
 >>> j
<VCARD| [<TEL{'TYPE': ['CELL']}0123456789>, <TEL{}>]>
 >>>
 >>> j.tel.value="9876543210"

Thanks for any hint

BR

Coert 



More information about the VObject mailing list