I've looked at the documentation and tests, but I'm not sure how to create a vcard with multiple addresses. I can parse a vcard with multiple addresses.<br><br>Here's what I am doing:<br><br><div style="margin-left: 40px;">
import vobject<br><br>v = vobject.vCard()<br><br>v.add('n')<br>v.n.value = <a href="http://vobject.vcard.Name">vobject.vcard.Name</a>( given='John', family='Smith' )<br><br>v.add('fn')<br>v.fn.value = 'John Smith'<br>
<br>v.add('adr')<br>adrs = []<br>adrs.append( vobject.vcard.Address( street='123 Main Street' ) )<br>adrs.append( vobject.vcard.Address( street='1313 Mockingbird Lane' ) )<br>v.adr_list = adrs<br><br>
print v.serialize()<br></div><br>On serialize, I receive the following stack trace:<br><br>Traceback (most recent call last):<br> File "./vobject_adr3.py", line 19, in <module><br> print v.serialize()<br>
File "/var/lib/python-support/python2.5/vobject/base.py", line 186, in serialize<br> return behavior.serialize(self, buf, lineLength, validate)<br> File "/var/lib/python-support/python2.5/vobject/behavior.py", line 148, in serialize<br>
if validate: cls.validate(obj, raiseException=True)<br> File "/var/lib/python-support/python2.5/vobject/behavior.py", line 83, in validate<br> if not child.validate(raiseException, complainUnrecognized):<br>
AttributeError: 'Address' object has no attribute 'validate'<br>