Package RelLib :: 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)
Creates a new Place object, copying from the source if present.
source code
tuple
serialize(self)
Converts the data held in the Place to a Python tuple that represents all the data elements.
source code
 
unserialize(self, data)
Converts 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)
Returns the list of all textual attributes of the object.
source code
list
get_text_data_child_list(self)
Returns the list of child objects that may carry textual data.
source code
list
get_sourcref_child_list(self)
Returns the list of child secondary objects that may refer sources.
source code
list
get_handle_referents(self)
Returns the list of child objects which may, directly or through their children, reference primary objects..
source code
list
get_referenced_handles(self)
Returns the list of (classname,handle) tuples for all directly referenced primary objects.
source code
 
set_title(self, title)
Sets the descriptive title of the Place object
source code
str
get_title(self)
Returns the descriptive title of the Place object
source code
 
set_longitude(self, longitude)
Sets the longitude of the Place object
source code
str
get_longitude(self)
Returns the longitude of the Place object
source code
 
set_latitude(self, latitude)
Sets the latitude of the Place object
source code
str
get_latitude(self)
Returns the latitude of the Place object
source code
Location
get_main_location(self)
Returns the Location object representing the primary information for the Place instance.
source code
 
set_main_location(self, location)
Assigns the main location information about the Place to the Location object passed
source code
list of Location objects
get_alternate_locations(self)
Returns a list of alternate Location objects the present alternate information about the current Place.
source code
 
set_alternate_locations(self, location_list)
Replaces the current alternate Location object list with the new one.
source code
 
add_alternate_locations(self, location)
Adds a Location object to the alternate location list
source code
 
get_display_info(self)
Gets the display information associated with the object.
source code

Inherited from _SourceBase.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 _PrimaryObject.PrimaryObject: get_marker, has_handle_reference, remove_handle_references, replace_handle_reference, set_marker

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

Inherited from _BaseObject.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 
Creates a new Place object, copying from the source if present.
Parameters:
  • source (Place) - A Place object used to initialize the new Place
Overrides: _SourceBase.SourceBase.__init__

serialize(self)

source code 

Converts 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: _SourceBase.SourceBase.serialize

unserialize(self, data)

source code 
Converts 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: _SourceBase.SourceBase.unserialize

get_text_data_list(self)

source code 
Returns the list of all textual attributes of the object.
Returns: list
Returns the list of all textual attributes of the object.
Overrides: _BaseObject.BaseObject.get_text_data_list

get_text_data_child_list(self)

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

get_sourcref_child_list(self)

source code 
Returns the list of child secondary objects that may refer sources.
Returns: list
List of child secondary child objects that may refer sources.
Overrides: _SourceBase.SourceBase.get_sourcref_child_list

get_handle_referents(self)

source code 
Returns 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: _BaseObject.BaseObject.get_handle_referents

get_referenced_handles(self)

source code 
Returns the list of (classname,handle) tuples for all directly referenced primary objects.
Returns: list
List of (classname,handle) tuples for referenced objects.
Overrides: _BaseObject.BaseObject.get_referenced_handles

set_title(self, title)

source code 
Sets the descriptive title of the Place object
Parameters:
  • title (str) - descriptive title to assign to the Place

get_title(self)

source code 
Returns the descriptive title of the Place object
Returns: str
Returns the descriptive title of the Place

set_longitude(self, longitude)

source code 
Sets the longitude of the Place object
Parameters:
  • longitude (str) - longitude to assign to the Place

get_longitude(self)

source code 
Returns the longitude of the Place object
Returns: str
Returns the longitude of the Place

set_latitude(self, latitude)

source code 
Sets the latitude of the Place object
Parameters:
  • latitude (str) - latitude to assign to the Place

get_latitude(self)

source code 
Returns the latitude of the Place object
Returns: str
Returns the latitude of the Place

get_main_location(self)

source code 
Returns 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 
Assigns 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 
Returns 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 
Replaces 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 
Adds a Location object to the alternate location list
Parameters:

get_display_info(self)

source code 

Gets 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