A Contact object represents a live view into the state of a single
contact in the database. You can access the fields either with a contact's
numeric field ID as
contact[fieldid], or using the
method. Attempting to modify a contact while it has been locked for editing
in another application will raise the exception
The unique ID of this Contact. Read-only.
The title of this Contact. Read-only.
The date/time when this Contact object was last modified. Read-only.
Returns 1 if this contact is a contact group. Returns 0 if normal contact entry. Read-only.
Contact objects have the following methods:
Locks the contact for editing. This prevents other applications from
modifying the contact for as long as the lock is held. This method will
raise the exception
ContactBusy if the contact has already been
Releases the lock and commits the changes made into the database.
Releases the lock and discards all changes that were made. The contact
remains in the state it was before
Returns the contact as a string in vCard format.
|type [, value [, label=field_label][, location=location_spec]])|
Adds a new field into this Contact. This method raises
ContactBusy if the contact has been locked by some other
application. type can be one of the supported field types as a
The following field types can be added:
The following field types are recognized but cannot be created at present:
All supported field types are passed as strings or Unicode strings, except for
'date' which is a float that represents Unix time. For more information
on Unix time, see Section
field_label is the name of the field shown to the user. If you do not pass a label, the default label for the field type is used.
location_spec, if given, must be
'work'. Note that not all combinations of type and location are
valid. The settings of the current contacts database in use determine which
ones are valid.
Finds the fields of this contact that match the given search specifications. If no parameters are given, all fields are returned.
Deletes the given field from this contact. Note that since this will change the indices of all fields that appear after this field in the contact, and since the ContactField objects refer to the fields by index, old ContactField objects that refer to fields after the deleted field will refer to different fields after this operation.
See About this document... for information on suggesting changes.