Package gen :: Package lib :: Module primaryobj :: Class PrimaryObject
[frames] | no frames]

Class PrimaryObject

source code


The PrimaryObject is the base class for all primary objects in the database.

Primary objects are the core objects in the database. Each object has a database handle and a GRAMPS ID value. The database handle is used as the record number for the database, and the GRAMPS ID is the user visible version.

Instance Methods
 
__init__(self, source=None)
Initialize a PrimaryObject.
source code
bool
has_handle_reference(self, classname, handle)
Return True if the object has reference to a given handle of given primary object type.
source code
 
remove_handle_references(self, classname, handle_list)
Remove all references in this object to object handles in the list.
source code
 
replace_handle_reference(self, classname, old_handle, new_handle)
Replace all references to old handle with those to the new handle.
source code
 
set_marker(self, marker)
Set the marker for the object.
source code
MarkerType
get_marker(self)
Return the marker for the object.
source code

Inherited from BasicPrimaryObject: get_change_display, get_change_time, get_gramps_id, get_handle, has_media_reference, has_source_reference, remove_media_references, remove_source_references, replace_media_references, replace_source_references, set_gramps_id, set_handle

Inherited from baseobj.BaseObject: get_handle_referents, get_referenced_handles, get_referenced_handles_recursively, get_text_data_child_list, get_text_data_list, matches_regexp, matches_string, serialize, unserialize

Inherited from privacybase.PrivacyBase: get_privacy, set_privacy

Method Details

__init__(self, source=None)
(Constructor)

source code 

Initialize a PrimaryObject.

If source is None, both the ID and handle are assigned as empty strings. If source is not None, then object is initialized from values of the source object.

Parameters:
  • source (PrimaryObject) - Object used to initialize the new object
Overrides: privacybase.PrivacyBase.__init__

has_handle_reference(self, classname, handle)

source code 

Return True if the object has reference to a given handle of given primary object type.

Parameters:
  • classname (str) - The name of the primary object class.
  • handle (str) - The handle to be checked.
Returns: bool
Returns whether the object has reference to this handle of this object type.
Overrides: BasicPrimaryObject.has_handle_reference

remove_handle_references(self, classname, handle_list)

source code 

Remove all references in this object to object handles in the list.

Parameters:
  • classname (str) - The name of the primary object class.
  • handle_list (str) - The list of handles to be removed.
Overrides: BasicPrimaryObject.remove_handle_references

replace_handle_reference(self, classname, old_handle, new_handle)

source code 

Replace all references to old handle with those to the new handle.

Parameters:
  • classname (str) - The name of the primary object class.
  • old_handle (str) - The handle to be replaced.
  • new_handle (str) - The handle to replace the old one with.
Overrides: BasicPrimaryObject.replace_handle_reference

set_marker(self, marker)

source code 

Set the marker for the object.

Parameters:
  • marker - marker assigned to the object
Overrides: BasicPrimaryObject.set_marker
(inherited documentation)

get_marker(self)

source code 

Return the marker for the object.

The exact type depends on the derived class type.

Returns: MarkerType
Returns the marker for the object.
Overrides: BasicPrimaryObject.get_marker
(inherited documentation)