POIs
This package contains both data models related to points of interest (POIs):
POI and
POITranslation.
POIs can be used to store information which is relevant for one specific location, e.g. a place where local authorities
offer a public service. They can also be used as location for an Event.
POI
- class integreat_cms.cms.models.pois.poi.POI(*args, **kwargs)[source]
Bases:
AbstractContentModelData model representing a point of interest (POI). It contains all relevant data about its exact position, including coordinates.
- Parameters:
id (BigAutoField) – Primary key: ID
created_date (DateTimeField) – Creation date
do_not_translate_title (BooleanField) – Do not translate the title. Tick if you do not want to translate the title by automatic translation.
address (CharField) – Street and house number
postcode (CharField) – Postal code
city (CharField) – City
country (CharField) – Country
latitude (FloatField) – Latitude. The latitude coordinate
longitude (FloatField) – Longitude. The longitude coordinate
location_on_map (BooleanField) – Show this location on map. Tick if you want to show this location on map
archived (BooleanField) – Archived. Whether or not the location is read-only and hidden in the API.
temporarily_closed (BooleanField) – Temporarily closed. Whether or not the location is temporarily closed. The opening hours remain and are only hidden.
appointment_url (URLField) – Appointment link. Link to an external website where an appointment for this location can be made.
opening_hours (JSONField) – Opening hours
barrier_free (BooleanField) – Barrier free. Indicate if the location is barrier free.
Relationship fields:
- Parameters:
region (
ForeignKeytoRegion) – Region (related name:pois)icon (
ForeignKeytoMediaFile) – Icon. The best results are achieved with images in 16:9 aspect ratio. (related name:pois)category (
ForeignKeytoPOICategory) – Category (related name:pois)organization (
ForeignKeytoOrganization) – Organization. Specify which organization operates this location. (related name:pois)
Reverse relationships:
- Parameters:
translations (Reverse
ForeignKeyfromPOITranslation) – All translations of this location (related name ofpoi)contacts (Reverse
ForeignKeyfromContact) – All contacts of this location (related name oflocation)events (Reverse
ForeignKeyfromEvent) – All events of this location (related name oflocation)
- exception DoesNotExist[source]
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned[source]
Bases:
MultipleObjectsReturned
- archive() bool[source]
Archives the poi and removes all links of this poi from the linkchecker
- Return type:
- property fallback_translations_enabled: bool[source]
Whether translations should be returned in the default language if they do not exist
- Returns:
Whether fallback translations are enabled
- static get_translation_model() ModelBase[source]
Returns the translation model of this content model
- Returns:
The class of translations
- Return type:
ModelBase
- property is_currently_used: bool[source]
- Returns:
whether this poi is used by a contact or an upcoming event
- map_url[source]
- Returns:
the link to the POI of the default (public) translation
- property referring_contacts_exist: bool[source]
return: whether there are contact objects referring the POI. If the contact module is disabled in the region, it’s always False
- short_address[source]
- Returns:
one-line representation of this POI’s address
POI Translation
- class integreat_cms.cms.models.pois.poi_translation.POITranslation(*args, **kwargs)[source]
Bases:
AbstractContentTranslationData model representing a POI translation
- Parameters:
id (BigAutoField) – Primary key: ID
title (TruncatingCharField) – Name of the location
slug (SlugField) – Link to the location. String identifier without spaces and special characters. Unique per region and language. Leave blank to generate unique parameter from title.
status (CharField) – Status
content (TextField) – Description
currently_in_translation (BooleanField) – Currently in translation. Flag to indicate a translation is being updated by an external translator
machine_translated (BooleanField) – Machine translated. Flag to indicate whether a translations is machine translated
version (PositiveIntegerField) – Revision
minor_edit (BooleanField) – Minor edit. Tick if this change does not require an update of translations in other languages.
last_updated (DateTimeField) – Modification date
automatic_translation (BooleanField) – Automatic translation. Tick if updating this content should automatically refresh or create its translations.
meta_description (CharField) – Meta description. Describe the location in one or two short sentences. This text will be displayed in the Google search results below the title.
Relationship fields:
- Parameters:
language (
ForeignKeytoLanguage) – Language (related name:poi_translations)creator (
ForeignKeytoUser) – Creator (related name:poi_translations)poi (
ForeignKeytoPOI) – Location (related name:translations)links (
GenericRelationtoLink) – Links (related name:poi_translation)
Reverse relationships:
- Parameters:
feedback (Reverse
ForeignKeyfromPOIFeedback) – All feedback of this location translation (related name ofpoi_translation)
- exception DoesNotExist[source]
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned[source]
Bases:
MultipleObjectsReturned
- backend_edit_link[source]
This function returns the absolute url to the editor for this translation
- Returns:
The url
- static default_icon() str | None[source]
- Returns:
The default icon that should be used for this content translation type, or
Nonefor no icon- Return type:
str | None
- static foreign_field() Literal['poi'][source]
Returns the string “poi” which ist the field name of the reference to the poi which the translation belongs to
- Returns:
The foreign field name
- Return type:
Literal[‘poi’]
- foreign_object[source]
This property is an alias of the POI foreign key and is needed to generalize the
slug_utilsfor all content types- Returns:
The POI to which the translation belongs
- map_url[source]
- Returns:
the link to the POI on the Integreat map (if it exists), to google maps otherwise
- save(*args: Any, **kwargs: Any) None[source]
Override save to perform unique slug validation
- Parameters:
args (Any)
kwargs (Any)
- Return type:
None
- classmethod search(region: Region, language_slug: str, query: str) QuerySet[source]
Searches for all content translations which match the given query in their title or slug. :param region: The current region :param language_slug: The language slug :param query: The query string used for filtering the content translations :return: A query for all matching objects
- status[source]
Type:
CharFieldStatus
Choices:
DRAFTREVIEWPUBLICAUTO_SAVE
Manage choices in
status
- url_infix[source]
Generates the infix of the url of the poi translation object
For information about the components of such an url, see
get_absolute_url()- Returns:
The infix of the url