Package gen :: Package lib :: Module place :: Class Place
[frames] | no frames]

Class Place

source code


Contains information related to a place, including multiple address information (since place names can change with time), longitude, latitude, a collection of images and URLs, a note and a source.

Instance Methods
 
__init__(self, source=None)
Create a new Place object, copying from the source if present.
source code
tuple
serialize(self)
Convert the data held in the Place 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 a Place object.
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_handle_referents(self)
Return the list of child objects which may, directly or through their children, reference primary objects.
source code
list
get_referenced_handles(self)
Return the list of (classname, handle) tuples for all directly referenced primary objects.
source code
 
set_title(self, title)
Set the descriptive title of the Place object.
source code
str
get_title(self)
Return the descriptive title of the Place object.
source code
 
set_longitude(self, longitude)
Set the longitude of the Place object.
source code
str
get_longitude(self)
Return the longitude of the Place object.
source code
 
set_latitude(self, latitude)
Set the latitude of the Place object.
source code
str
get_latitude(self)
Return the latitude of the Place object.
source code
Location
get_main_location(self)
Return the Location object representing the primary information for the Place instance.
source code
 
set_main_location(self, location)
Assign the main location information about the Place to the Location object passed.
source code
list of Location objects
get_alternate_locations(self)
Return a list of alternate Location objects the present alternate information about the current Place.
source code
 
set_alternate_locations(self, location_list)
Replace the current alternate Location object list with the new one.
source code
 
add_alternate_locations(self, location)
Add a Location object to the alternate location list.
source code
 
get_display_info(self)
Get the display information associated with the object.
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 urlbase.UrlBase: add_url, get_url_list, remove_url, set_url_list

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 Place object, copying from the source if present.

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

serialize(self)

source code 

Convert the data held in the Place 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 a Place object.

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
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_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

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

set_title(self, title)

source code 

Set the descriptive title of the Place object.

Parameters:
  • title (str) - descriptive title to assign to the Place

get_title(self)

source code 

Return the descriptive title of the Place object.

Returns: str
Returns the descriptive title of the Place

set_longitude(self, longitude)

source code 

Set the longitude of the Place object.

Parameters:
  • longitude (str) - longitude to assign to the Place

get_longitude(self)

source code 

Return the longitude of the Place object.

Returns: str
Returns the longitude of the Place

set_latitude(self, latitude)

source code 

Set the latitude of the Place object.

Parameters:
  • latitude (str) - latitude to assign to the Place

get_latitude(self)

source code 

Return the latitude of the Place object.

Returns: str
Returns the latitude of the Place

get_main_location(self)

source code 

Return the Location object representing the primary information for the Place instance.

If a Location hasn't been assigned yet, an empty one is created.

Returns: Location
Returns the Location instance representing the primary location information about the Place.

set_main_location(self, location)

source code 

Assign the main location information about the Place to the Location object passed.

Parameters:
  • location (Location) - Location instance to assign to as the main information for the Place.

get_alternate_locations(self)

source code 

Return a list of alternate Location objects the present alternate information about the current Place.

A Place can have more than one Location, since names and jurisdictions can change over time for the same place.

Returns: list of Location objects
Returns the alternate Locations for the Place

set_alternate_locations(self, location_list)

source code 

Replace the current alternate Location object list with the new one.

Parameters:
  • location_list (list of Location objects) - The list of Location objects to assign to the Place's internal list.

add_alternate_locations(self, location)

source code 

Add a Location object to the alternate location list.

Parameters:

get_display_info(self)

source code 

Get the display information associated with the object.

This includes the information that is used for display and for sorting. Returns a list consisting of 13 strings. These are:

Place Title, Place ID, Main Location Parish, Main Location County, Main Location City, Main Location State/Province, Main Location Country, upper case Place Title, upper case Parish, upper case city, upper case county, upper case state, upper case country.