Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create multi-value entries for e.g. TEL? #80

Closed
htgoebel opened this issue Jun 21, 2017 · 1 comment · Fixed by #88
Closed

How to create multi-value entries for e.g. TEL? #80

htgoebel opened this issue Jun 21, 2017 · 1 comment · Fixed by #88

Comments

@htgoebel
Copy link
Contributor

htgoebel commented Jun 21, 2017

Thanks for improving the documentation about multi-value entries (see #78, #79). When rethinking this, I found a few more places for improvement:

1. How to create multi-value entries

The example from the documentation only shows a simple entry. This is an example for adding a second entry:

>>> import vobject
>>> j = vobject.vCard()
>>> e1 = j.add('email')
>>> j.email.value = 'jeffrey@osafoundation.org'  # intentionally using a different way here
>>> e2 = j.add('email')
>>> e2.value = "john@example.com"
>>> e1
<EMAIL{}jeffrey@osafoundation.org>
>>> e2
<EMAIL{}hartmut@goe-con.de>
>>> j.email
<EMAIL{}jeffrey@osafoundation.org>

2. How to determine if an entry is multi-valued?

According to this test, it seems that email entries (and presumable tel etc.) are always lists:

>>> k = vobject.vCard()
>>> k.add('email')
<EMAIL{}>
>>> k.contents['email'].__class__
<class 'list'>

Please documents this and also which entries are lists.

@htgoebel htgoebel changed the title How to create multi-type entries for e.g. TEL? How to create multi-value entries for e.g. TEL? Jun 21, 2017
@wpercy
Copy link
Contributor

wpercy commented Jun 21, 2017

Feel free to make a Pull Request with any changes you think would be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants