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:

Reverse relationships:

Parameters:
exception DoesNotExist[source]

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

archive() None[source]

Archives the poi and removes all links of this poi from the linkchecker

Return type:

None

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

restore() None[source]

Restores the event and adds all links of this event back

Return type:

None

integreat_cms.cms.models.pois.poi.get_default_opening_hours() list[dict[str, Any]][source]

Return the default opening hours

Returns:

The default opening hours

Return type:

list[dict[str, Any]]

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 (CharField) – 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:

Reverse relationships:

Parameters:

feedback (Reverse ForeignKey from POIFeedback) – All feedback of this location translation (related name of poi_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 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

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