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:
AbstractContentModel
Data 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
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.
website (URLField) – Website
email (EmailField) – Email address
phone_number (CharField) – Phone number
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 (
ForeignKey
toRegion
) – Region (related name:pois
)icon (
ForeignKey
toMediaFile
) – Icon. The best results are achieved with images in 16:9 aspect ratio. (related name:pois
)category (
ForeignKey
toPOICategory
) – Category (related name:pois
)organization (
ForeignKey
toOrganization
) – Organization. Specify which organization operates this location. (related name:pois
)
Reverse relationships:
- Parameters:
translations (Reverse
ForeignKey
fromPOITranslation
) – All translations of this location (related name ofpoi
)contacts (Reverse
ForeignKey
fromContact
) – All contacts of this location (related name oflocation
)events (Reverse
ForeignKey
fromEvent
) – 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:
- delete(*args: list, **kwargs: dict) bool [source]
Deletes the poi :param *args: The supplied arguments :param **kwargs: The supplied keyword arguments
- 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
- map_url[source]
- Returns:
the link to the POI of the default (public) translation
- 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:
AbstractContentTranslation
Data 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 (
ForeignKey
toLanguage
) – Language (related name:poi_translations
)creator (
ForeignKey
toUser
) – Creator (related name:poi_translations
)poi (
ForeignKey
toPOI
) – Location (related name:translations
)links (
GenericRelation
toLink
) – Links (related name:poi_translation
)
Reverse relationships:
- Parameters:
feedback (Reverse
ForeignKey
fromPOIFeedback
) – 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
None
for 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_utils
for 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
- 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:
CharField
Status
Choices:
DRAFT
REVIEW
PUBLIC
AUTO_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