5.2.3 Entry Objects

An Entry object represents a live view into the state of a single entry in the database. You can access the entries with an entry's unique ID. If you create a new entry using db.add_appointment etc., it is saved into the database only if you call the entry's commit method. In case an entry is already saved into the database, the autocommit mode is on by default and all the changes are automatically saved into the database, unless you call the entry's begin method. If you call the entry's begin method, the changes are not saved into the database until you call the entry's commit method.

Database entries cannot be locked. In other words, other applications are able to make changes to the database entries you are using (not directly to the EntryObjects you are using, but to their representation in the database) at the same time you are modifying them, even if you use begin and commit methods.

class Entry
Entry objects have the following methods and properties:

content

Sets or returns the entry's content text (Unicode).

commit( )

Saves the entry or in case of a new entry adds the entry into the database. Note that this can be called only in case of a new entry, created with db.add_appointment etc., or after begin is called.

rollback( )

Undoes the changes made after last commit.

set_repeat( dictionary)

Sets the repeat data of the entry. dictionary is a repeat data dictionary that contains all the repeat rules. For more information on repeat rules, see Section 5.2.4, Repeat Rules.

get_repeat( )

Returns the repeat data dictionary of the entry.

location

Sets or returns the entry's location data (Unicode), for example meeting room information.

set_time( start[, end])

Sets the start and end datetime values of the entry (floats). If only one parameter is given, the other will have the same value.

In case of events, anniversaries, and todo entries the datetime values are truncated to corresponding date values.

TodoEntries can be made undated with TodoEntry.set_time(None). Making the todo entry undated means removing the start and end date and all the repeat rules.

start_time

The start datetime value (float) of the entry or None if the start datetime of the entry is not set.

end_time

The end datetime value (float) of the entry or None if the end datetime of the entry is not set.

id

The unique ID of the entry.

last_modified

The datetime value (float) of the entry's last modification in universal time.

originating

An integer value indicating if the entry is an originating entry or a modifying entry.

alarm

The alarm datetime value (float) for the entry. None if alarm is not set. Alternatively removes the alarm if the value is set to None.

Alarms can be set to all Entry types. However, only alarms set to Appointments and Anniversaries will actually cause an alarm; this is similar to the Calendar application in your Nokia device, which allows you to set an alarm only for Meetings and Anniversaries. In addition, alarms set to any entries residing in a database other than the default database do not cause actual alarms either.

priority

The priority of the entry, which can be an integer ranging from 0 to 255. Native Phonebook and Calendar applications in Nokia devices use value 1 for high priority, 2 for normal priority, and 3 for low priority.

crossed_out

The crossed out value of an entry. Only valid for todo entries. A value that is interpreted as false means that the entry is not crossed out, whereas a value that is interpreted as true means that the entry is crossed out. Note that TodoEntries must also have a cross-out time. If TodoEntry is crossed out using this method, the moment of crossing out is set to the cross-out time of the TodoEntry. See also Section 5.2.3, TodoEntry, cross_out_time.

replication

Sets or returns the entry's replication status, which can be one of the following: 'open', 'private', or 'restricted'.

as_vcalendar( )

Returns this entry as a vCalendar string.



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