geonode.base.models
Attributes
Classes
ContactRole is an intermediate model to bind Profiles as Contacts to Resources and apply roles. |
|
Metadata about high-level geographic data thematic classification. |
|
Metadata information about the spatial representation type. |
|
Save bbox values in the database. |
|
Metadata information about the spatial representation type. |
|
QuerySet to automatically create a root node if depth not given. |
|
Loadable thesaurus containing keywords in different languages |
|
Loadable thesaurus containing keywords in different languages |
|
Loadable thesaurus containing keywords in different languages |
|
Contains localized version of the thesaurus title |
|
Base Resource Object loosely based on ISO 19115:2003 |
|
Helper class to access links grouped by type |
|
Auxiliary model for storing links for resources. |
|
A model used for managing the Geonode instance's global configuration, without a need for reloading the instance. |
|
Functions
|
|
|
Used to fill the average rating field on OverallRating change. |
Module Contents
- class geonode.base.models.ContactRole[source]
Bases:
django.db.models.ModelContactRole is an intermediate model to bind Profiles as Contacts to Resources and apply roles.
- class geonode.base.models.TopicCategory[source]
Bases:
django.db.models.ModelMetadata about high-level geographic data thematic classification.
It should reflect a list of codes from TC211
See: http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
<CodeListDictionary gml:id=”MD_MD_TopicCategoryCode”>
- class geonode.base.models.SpatialRepresentationType[source]
Bases:
django.db.models.ModelMetadata information about the spatial representation type.
It should reflect a list of codes from TC211
See: http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
<CodeListDictionary gml:id=”MD_SpatialRepresentationTypeCode”>
- class geonode.base.models.Region[source]
Bases:
mptt.models.MPTTModelSave bbox values in the database.
This is useful for spatial searches and for generating thumbnail images and metadata records.
- class geonode.base.models.RestrictionCodeType[source]
Bases:
django.db.models.ModelMetadata information about the spatial representation type. It should reflect a list of codes from TC211
See: http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml
<CodeListDictionary gml:id=”MD_RestrictionCode”>
- class geonode.base.models.HierarchicalKeywordQuerySet[source]
Bases:
treebeard.mp_tree.MP_NodeQuerySetQuerySet to automatically create a root node if depth not given.
- class geonode.base.models.HierarchicalKeywordManager[source]
Bases:
treebeard.mp_tree.MP_NodeManager
- class geonode.base.models.HierarchicalKeyword[source]
Bases:
taggit.models.TagBase,treebeard.mp_tree.MP_Node
- class geonode.base.models.Thesaurus[source]
Bases:
django.db.models.ModelLoadable thesaurus containing keywords in different languages
- class geonode.base.models.ThesaurusKeywordLabel[source]
Bases:
django.db.models.ModelLoadable thesaurus containing keywords in different languages
- class geonode.base.models.ThesaurusKeyword[source]
Bases:
django.db.models.ModelLoadable thesaurus containing keywords in different languages
- class geonode.base.models.ThesaurusLabel[source]
Bases:
django.db.models.ModelContains localized version of the thesaurus title
- class geonode.base.models.ResourceBaseManager[source]
Bases:
polymorphic.managers.PolymorphicManager
- class geonode.base.models.ResourceBase(*args, **kwargs)[source]
Bases:
polymorphic.models.PolymorphicModel,geonode.security.models.PermissionLevelMixin,taggit.models.ItemBaseBase Resource Object loosely based on ISO 19115:2003
- save(notify=False, *args, **kwargs)[source]
Send a notification when a resource is created or updated
- delete(notify=True, *args, **kwargs)[source]
Send a notification when a layer, map or document is deleted
- property ll_bbox[source]
- BBOX is in the format
[x0, x1, y0, y1, "EPSG:srid"]
Provides backwards compatibility after transition to polygons.
- property bbox_string[source]
- BBOX is in the format:
[x0, y0, x1, y1]
Provides backwards compatibility after transition to polygons.
- property geographic_bounding_box[source]
- Returns an EWKT representation of the bounding box in EPSG 4326
- set_bbox_polygon(bbox, srid)[source]
Set bbox_polygon from bbox values.
- Parameters:
bbox – list or tuple formatted as [xmin, ymin, xmax, ymax]
srid – srid as string (e.g. ‘EPSG:4326’ or ‘4326’)
- set_ll_bbox_polygon(bbox, srid='EPSG:4326')[source]
Set ll_bbox_polygon from bbox values.
- Parameters:
bbox – list or tuple formatted as [xmin, ymin, xmax, ymax]
srid – srid as string (e.g. ‘EPSG:4326’ or ‘4326’)
- set_bounds_from_bbox(bbox, srid)[source]
Calculate zoom level and center coordinates in mercator.
- Parameters:
bbox (list) –
BBOX is either a geos.Pologyon or in the format: [x0, x1, y0, y1], which is:
[min lon, max lon, min lat, max lat]
or
[xmin, xmax, ymin, ymax]
- get_legend_url(style_name=None)[source]
Return URL for legend or None if it does not exist.
The legend can be either an image (for Geoserver’s WMS) or a JSON object for ArcGIS.
- get_thumbnail_url()[source]
Return a thumbnail url.
It could be a local one if it exists, a remote one (WMS GetImage) for example
- set_missing_info()[source]
Set default permissions and point of contacts.
It is mandatory to call it from descendant classes but hard to enforce technically via signals or save overriding.
- add_missing_metadata_author_or_poc()[source]
Set metadata_author and/or point of contact (poc) to a resource when any of them is missing
- static get_multivalue_role_property_names() List[str][source]
Returns list of property names for all contact roles able to handle multiple profile_users
- Returns:
list of names
- Return type:
list[str]
- static get_multivalue_required_role_property_names() List[str][source]
Returns list of property names for all contact roles that are required
- Returns:
list of names
- Return type:
list[str]
- static get_ui_toggled_role_property_names() List[str][source]
Returns list of property names for all contact roles that are toggled of in metadata_editor
- Returns:
list of names
- Return type:
list[str]
- set_contact_roles_from_metadata_edit(resource_base_form) bool[source]
Gets a ResourceBaseForm and extracts the Contact Role elements from it
- Parameters:
resource_base_form (ResourceBaseForm) – ResourceBaseForm with contact roles set
- Returns:
True if all contact roles could be set, else False.
- Return type:
bool
- __get_contact_role_elements__(role: str) List[django.conf.settings.AUTH_USER_MODEL] | None[source]
General getter of for all contact roles except owner
- Parameters:
role (str) – String corresponding to ROLE_VALUES in geonode/people/enumerations, defining which property is requested.
- Returns:
The requested contact role from the database or None if not found.
- Return type:
Optional[List[settings.AUTH_USER_MODEL]]
- __set_contact_role_element__(user_profile: CONTACT_ROLE_USER_PROFILES_ALLOWED_TYPES, role: str)[source]
General setter for all contact roles except owner in resource base.
- Parameters:
user_profile (CONTACT_ROLE_USER_PROFILES_ALLOWED_TYPES) – The user profile to be set, must be one of the allowed types in CONTACT_ROLE_USER_PROFILES_ALLOWED_TYPES.
role (str) – String corresponding to ROLE_VALUES in geonode/people/enumerations, defining which property is to be set.
- get_defined_multivalue_contact_roles() List[Tuple[List[django.conf.settings.AUTH_USER_MODEL], str]][source]
Returns all set contact roles of the resource with additional ROLE_VALUES from geonode.people.enumerations.ROLE_VALUES. Mainly used to simplify the generation of output XML.
- Returns:
A list of tuples, where each tuple contains: 1. A list of people who have a certain role. 2. The role label.
- Return type:
List[Tuple[List[people object], str]]
- get_first_contact_of_role(role: str) ContactRole | None[source]
Get the first contact from the specified role.
- Parameters:
role (str) – The role of the contact.
- Returns:
The first contact with the specified role, or None if not found.
- Return type:
Optional[ContactRole]
- class geonode.base.models.LinkManager[source]
Bases:
django.db.models.ManagerHelper class to access links grouped by type
- class geonode.base.models.LinkedResource[source]
Bases:
django.db.models.Model- classmethod get_linked_resources(source: ResourceBase = None, target: ResourceBase = None, is_internal: bool = None)[source]
- classmethod get_target_ids(source: ResourceBase, is_internal: bool = None)[source]
- classmethod get_targets(source: ResourceBase, is_internal: bool = None)[source]
- class geonode.base.models.Link[source]
Bases:
django.db.models.ModelAuxiliary model for storing links for resources.
This helps avoiding the need for runtime lookups to the OWS server or the CSW Catalogue.
There are four types of links:
original: For uploaded files (Shapefiles or GeoTIFFs)
data: For WFS and WCS links that allow access to raw data
image: For WMS and TMS links
metadata: For CSW links
OGC:WMS: for WMS service links
OGC:WFS: for WFS service links
OGC:WCS: for WCS service links
- class geonode.base.models.Configuration[source]
Bases:
geonode.singleton.SingletonModelA model used for managing the Geonode instance’s global configuration, without a need for reloading the instance.
Usage: from geonode.base.models import Configuration
config = Configuration.load()