
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1203 fd906abe-77d9-0310-91a1-e0d9ade77398
41 lines
876 B
Text
41 lines
876 B
Text
Organizations: Persons, Institutions, Addresses...
|
|
==================================================
|
|
|
|
Let's start with a Person:
|
|
|
|
>>> from cybertools.organize.party import Person
|
|
>>> john = Person(u'Smith')
|
|
>>> john.lastName
|
|
u'Smith'
|
|
>>> john.firstName
|
|
u''
|
|
>>> john.birthDate is None
|
|
True
|
|
>>> john.addresses
|
|
{}
|
|
|
|
A Person object knows the age of the person:
|
|
|
|
>>> john.age
|
|
|
|
>>> from datetime import date
|
|
>>> john.birthDate = date(1980, 3, 25)
|
|
>>> john.age
|
|
26
|
|
|
|
>>> john.firstName = u'John'
|
|
>>> john.firstName
|
|
u'John'
|
|
|
|
Addresses
|
|
---------
|
|
|
|
Let's create an address and assign it to a person:
|
|
|
|
>>> from contact.address import Address
|
|
>>> addr = Address('München'.decode('UTF-8'),
|
|
... 'Bayerstraße 1'.decode('UTF-8'))
|
|
>>> john.addresses['standard'] = addr
|
|
>>> john.addresses['standard'].street
|
|
u'Bayerstra\xdfe 1'
|
|
|