Package gen :: Package lib :: Module event :: Class Event
[frames] | no frames]

Class Event

source code


Introduction

The Event record is used to store information about some type of action that occurred at a particular place at a particular time, such as a birth, death, or marriage.

Instance Methods
 
__init__(self, source=None)
Create a new Event instance, copying from the source if present.
source code
tuple
serialize(self, no_text_date=False)
Convert the data held in the event to a Python tuple that represents all the data elements.
source code
 
unserialize(self, data)
Convert the data held in a tuple created by the serialize method back into the data in an Event structure.
source code
list
get_text_data_list(self)
Return the list of all textual attributes of the object.
source code
list
get_text_data_child_list(self)
Return the list of child objects that may carry textual data.
source code
list
get_sourcref_child_list(self)
Return the list of child secondary objects that may refer sources.
source code
list
get_note_child_list(self)
Return the list of child secondary objects that may refer notes.
source code
list
get_referenced_handles(self)
Return the list of (classname, handle) tuples for all directly referenced primary objects.
source code
list
get_handle_referents(self)
Return the list of child objects which may, directly or through their children, reference primary objects.
source code
bool
is_empty(self)
Return True if the Event is an empty object (no values set).
source code
bool
are_equal(self, other)
Return True if the passed Event is equivalent to the current Event.
source code
 
set_type(self, the_type)
Set the type of the Event to the passed (int,str) tuple.
source code
tuple
get_type(self)
Return the type of the Event.
source code
 
set_description(self, description)
Set the description of the Event to the passed string.
source code
str
get_description(self)
Return the description of the Event.
source code

Inherited from srcbase.SourceBase: add_source_reference, get_source_references, has_source_reference, remove_source_references, replace_source_references, set_source_reference_list

Inherited from notebase.NoteBase: add_note, get_note_list, get_referenced_note_handles, remove_note, set_note_list

Inherited from mediabase.MediaBase: add_media_reference, get_media_list, has_media_reference, remove_media_references, replace_media_references, set_media_list

Inherited from attrbase.AttributeBase: add_attribute, get_attribute_list, remove_attribute, set_attribute_list

Inherited from datebase.DateBase: get_date_object, set_date_object

Inherited from placebase.PlaceBase: get_place_handle, set_place_handle

Inherited from primaryobj.PrimaryObject: get_marker, has_handle_reference, remove_handle_references, replace_handle_reference, set_marker

Inherited from primaryobj.BasicPrimaryObject: get_change_display, get_change_time, get_gramps_id, get_handle, set_gramps_id, set_handle

Inherited from baseobj.BaseObject: get_referenced_handles_recursively, matches_regexp, matches_string

Inherited from privacybase.PrivacyBase: get_privacy, set_privacy

Method Details

__init__(self, source=None)
(Constructor)

source code 

Create a new Event instance, copying from the source if present.

Parameters:
  • source (Event) - An event used to initialize the new event
Overrides: privacybase.PrivacyBase.__init__

serialize(self, no_text_date=False)

source code 

Convert the data held in the event to a Python tuple that represents all the data elements.

This method is used to convert the object into a form that can easily be saved to a database.

These elements may be primative Python types (string, integers), complex Python types (lists or tuples, or Python objects. If the target database cannot handle complex types (such as objectes or lists), the database is responsible for converting the data into a form that it can use.

Returns: tuple
Returns a python tuple containing the data that should be considered persistent.
Overrides: privacybase.PrivacyBase.serialize

unserialize(self, data)

source code 

Convert the data held in a tuple created by the serialize method back into the data in an Event structure.

Parameters:
  • data (tuple) - tuple containing the persistent data associated the Person object
Overrides: privacybase.PrivacyBase.unserialize

get_text_data_list(self)

source code 

Return the list of all textual attributes of the object.

Returns: list
Returns the list of all textual attributes of the object.
Overrides: baseobj.BaseObject.get_text_data_list

get_text_data_child_list(self)

source code 

Return the list of child objects that may carry textual data.

Returns: list
Returns the list of child objects that may carry textual data.
Overrides: baseobj.BaseObject.get_text_data_child_list

get_sourcref_child_list(self)

source code 

Return the list of child secondary objects that may refer sources.

Returns: list
Returns the list of child secondary child objects that may refer sources.
Overrides: srcbase.SourceBase.get_sourcref_child_list

get_note_child_list(self)

source code 

Return the list of child secondary objects that may refer notes.

Returns: list
Returns the list of child secondary child objects that may refer notes.
Overrides: notebase.NoteBase.get_note_child_list

get_referenced_handles(self)

source code 

Return the list of (classname, handle) tuples for all directly referenced primary objects.

Returns: list
List of (classname, handle) tuples for referenced objects.
Overrides: baseobj.BaseObject.get_referenced_handles

get_handle_referents(self)

source code 

Return the list of child objects which may, directly or through their children, reference primary objects.

Returns: list
Returns the list of objects refereincing primary objects.
Overrides: baseobj.BaseObject.get_handle_referents

is_empty(self)

source code 

Return True if the Event is an empty object (no values set).

Returns: bool
True if the Event is empty

are_equal(self, other)

source code 

Return True if the passed Event is equivalent to the current Event.

Parameters:
  • other (Event) - Event to compare against
Returns: bool
True if the Events are equal

set_type(self, the_type)

source code 

Set the type of the Event to the passed (int,str) tuple.

Parameters:
  • the_type (tuple) - Type to assign to the Event

get_type(self)

source code 

Return the type of the Event.

Returns: tuple
Type of the Event

set_description(self, description)

source code 

Set the description of the Event to the passed string.

The string may contain any information.

Parameters:
  • description (str) - Description to assign to the Event

get_description(self)

source code 

Return the description of the Event.

Returns: str
Returns the description of the Event