Offers

This package contains OfferTemplate

Offer Template

class integreat_cms.cms.models.offers.offer_template.OfferTemplate(*args, **kwargs)[source]

Bases: AbstractBaseModel

The OfferTemplate model is used to store templates of offers which can be activated for specific regions. The information stored in an offer template is global, so if you need parameters, which depend on local information of a region, it has to be added to the Region model.

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

  • name (CharField) – Name

  • slug (SlugField) – Slug. String identifier without spaces and special characters. Unique per region and language. Leave blank to generate unique parameter from name

  • thumbnail (URLField) – Thumbnail URL

  • url (URLField) – URL. This will be an external API endpoint in most cases.

  • post_data (JSONField) – POST parameter. Additional POST data for retrieving the URL. Specify as JSON.

  • use_postal_code (CharField) –

    Use postal code. Whether and how to insert the postcode of the region into the URL or POST data

    Manage choices in postal_code

  • supported_by_app_in_content (BooleanField) – Supported by app in content. Whether the Integreat app supports displaying offers from this provider in pages

  • is_zammad_form (BooleanField) – Is Zammad form. Whether this offer should be treated as a Zammad form by the App

  • created_date (DateTimeField) – Creation date

  • last_updated (DateTimeField) – Modification date

Reverse relationships:

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 <OfferTemplate: OfferTemplate object (id)>. It is used for logging.

Returns:

The canonical string representation of the offer template

Return type:

str

use_postal_code[source]

Type: CharField

Use postal code. Whether and how to insert the postcode of the region into the URL or POST data

Choices:

  • NONE

  • GET

  • POST

Manage choices in postal_code