POI Categories

This package contains page-related data models:

POI Category

class integreat_cms.cms.models.poi_categories.poi_category.POICategory(*args, **kwargs)[source]

Bases: AbstractBaseModel

Data model representing a POI category.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • icon (CharField) – Icon. Select an icon for this category

  • color (CharField) – Color. Select a color for map pins with this category

Reverse relationships:

Parameters:
exception DoesNotExist[source]

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

backend_translation[source]

This function returns the translation of this content object in the current backend language.

Returns:

The backend translation of a content object

best_translation[source]

This function returns the translation of this category in the current backend language and if it doesn’t exist, it provides a fallback to the first translation.

Returns:

The “best” translation of this category for displaying in the backend

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <POI Category: POICategory object (id, category name)>. It is used for logging.

Returns:

The canonical string representation of the category

Return type:

str

get_translation(language_slug: str) POICategoryTranslation | None[source]

Get the translation of this category in a given language

Parameters:

language_slug (str) – language in which the poi category is to be shown

Returns:

translation of the poi category in the language if no translation is saved for the language, the category name of the POICategory

Return type:

POICategoryTranslation | None

name[source]

This function returns the name of the category in the “best” translation

Returns:

The name of the category

prefetched_translations_by_language_slug[source]

This method returns a mapping from language slugs to their public translations of this object

Returns:

The object translation in the requested Language or None if no translation exists

POI Category Translation

class integreat_cms.cms.models.poi_categories.poi_category_translation.POICategoryTranslation(*args, **kwargs)[source]

Bases: AbstractBaseModel

Data model representing a POI category translation.

Parameters:
  • id (BigAutoField) – Primary key: ID

  • name (CharField) – Category name. The name of the POI category.

Relationship fields:

Parameters:
exception DoesNotExist[source]

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned[source]

Bases: MultipleObjectsReturned

get_repr() str[source]

This overwrites the default Django __repr__() method which would return <POI CategoryTranslation: POICategoryTranslation object (id, category name)>. It is used for logging.

Returns:

The canonical string representation of the category translation

Return type:

str