5.2.2 CalendarDb Objects

Calendar entries are stored in a calendar database. There is one default calendar database but more calendar databases can be created by invoking open with parameters 'n' or 'c'.

class CalendarDb
CalendarDb objects have the following methods:

add_appointment( )

Creates and returns a new appointment entry AppointmentEntry. The entry is not added and saved into the database until Entry.commit is called.

add_event( )

Creates and returns a new event entry EventEntry. The entry is not added and saved into the database until Entry.commit is called.

add_anniversary( )

Creates and returns a new anniversary entry AnniversaryEntry. The entry is not added and saved into the database until Entry.commit is called.

add_todo( )

Creates and returns new todo entry TodoEntry. The entry is not added and saved into the database until Entry.commit is called.

add_reminder( )

Creates and returns new reminder entry ReminderEntry. The entry is not added and saved into the database until Entry.commit is called.

find_instances( start_date, end_date, search_str=u''[ ,appointments=0,events=0,anniversaries=0,todos=0,reminders=0])

The parameters for this function include the start date, end date, search string, and optional parameters. The optional parameters define the entry types to be included into the search. By default all entry types are included. Returns a list that contains Entry instances found in the search. An instance is a dictionary that contains the entry ID and the datetime value. An entry may have several instances if it is repeated, for example once every week, etc.

In some Nokia models the search_str needs to be less or equal to 32 characters, otherwise an error KErrArgument or a premature application exit (i.e. a panic) might occur.

monthly_instances( month, appointments=0, events=0, anniversaries=0, todos=0, reminders=0)

The parameters for this function include month (float) and optional parameters. The optional parameters define the entry types to be returned. Returns a list that contains entry instances occurring during the specified calendar month.

daily_instances( day, appointments=0, events=0, anniversaries=0, todos=0)

The parameters for this function include day (float) and optional parameters. The optional parameters define the entry types to be returned. Returns a list that contains entry instances occurring on the specified day.

export_vcalendars( (int,...))

Returns a vcalendar string that contains the specified entries in vCalendar format. The parameter for this function is a tuple that contains the entry IDs of the exported entries.

import_vcalendars( string)

Imports vcalendar entries, given in the string parameter, to the database. Returns a list that contains the unique IDs of the imported entries.

__delitem__( id)

Deletes the given calendar Entry from the database. id is the unique ID of the calendar Entry.

__getitem__( id)

Returns a calendar Entry object indicated by the unique ID. The returned object can be one of the following: AppointmentEntry, EventEntry, AnniversaryEntry, ReminderEntry, or TodoEntry. id is the unique ID of the calendar Entry.

See About this document... for information on suggesting changes.