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

Class BasicPrimaryObject

source code


The BasicPrimaryObject is the base class for Note objects.

It is also the base class for the PrimaryObject class.

The PrimaryObject is the base class for all other 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
int
get_change_time(self)
Return the time that the data was last changed.
source code
str
get_change_display(self)
Return the string representation of the last change time.
source code
 
set_handle(self, handle)
Set the database handle for the primary object.
source code
str
get_handle(self)
Return the database handle for the primary object.
source code
 
set_gramps_id(self, gramps_id)
Set the GRAMPS ID for the primary object.
source code
str
get_gramps_id(self)
Return the GRAMPS ID for the primary object.
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
 
has_source_reference(self, handle)
Indicate if the object has a source references.
source code
 
has_media_reference(self, handle)
Indicate if the object has a media references.
source code
 
remove_source_references(self, handle_list)
Remove the specified source references from the object.
source code
 
remove_media_references(self, handle_list)
Remove the specified media references from the object.
source code
 
replace_source_references(self, old_handle, new_handle) source code
 
replace_media_references(self, old_handle, new_handle) source code

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__

get_change_time(self)

source code 

Return the time that the data was last changed.

The value in the format returned by the time.time() command.

Returns: int
Time that the data was last changed. The value in the format returned by the time.time() command.

get_change_display(self)

source code 

Return the string representation of the last change time.

Returns: str
string representation of the last change time.

set_handle(self, handle)

source code 

Set the database handle for the primary object.

Parameters:
  • handle (str) - object database handle

get_handle(self)

source code 

Return the database handle for the primary object.

Returns: str
database handle associated with the object

set_gramps_id(self, gramps_id)

source code 

Set the GRAMPS ID for the primary object.

Parameters:
  • gramps_id (str) - GRAMPS ID

get_gramps_id(self)

source code 

Return the GRAMPS ID for the primary object.

Returns: str
GRAMPS ID associated with the object

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.

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.

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.

set_marker(self, marker)

source code 

Set the marker for the object.

Parameters:
  • marker (MarkerType) - marker assigned to the object

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.

has_source_reference(self, handle)

source code 

Indicate if the object has a source references.

In the base class, no such references exist. Derived classes should override this if they provide source references.

has_media_reference(self, handle)

source code 

Indicate if the object has a media references.

In the base class, no such references exist. Derived classes should override this if they provide media references.

remove_source_references(self, handle_list)

source code 

Remove the specified source references from the object.

In the base class no such references exist. Derived classes should override this if they provide source references.

remove_media_references(self, handle_list)

source code 

Remove the specified media references from the object.

In the base class no such references exist. Derived classes should override this if they provide media references.