models.Banner

class Banner(json, client)[source]

A virtual object representing a KE-chain Banner.

New in version 3.6.

Construct a banner from the provided json data.

edit(text: str | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, icon: str | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, active_from: ~datetime.datetime | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, active_until: ~datetime.datetime | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, is_active: bool | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, url: str | ~pykechain.utils.Empty | None = <pykechain.utils.Empty object>, **kwargs) None[source]

Update the banner properties.

Setting an input to None will clear out the value (exception being text, active_from, active_until and is_active).

Parameters:
  • text (basestring or Empty) – Text to display in the banner. May use HTML. Text cannot be cleared.

  • icon (basestring or None or Empty) – Font-awesome icon to stylize the banner. Can be cleared.

  • active_from (datetime.datetime or None or Empty) – Datetime from when the banner will become active. Cannot be cleared.

  • active_until (datetime.datetime or None or Empty) – Datetime from when the banner will no longer be active. Cannot be cleared.

  • is_active (bool or Empty) – Boolean whether to set the banner as active, defaults to False. Cannot be cleared.

  • url – target for the “more info” button within the banner. Can be cleared.

  • url – basestring or None or Empty

Returns:

None

Not mentioning an input parameter in the function will leave it unchanged. Setting a parameter as None will clear its value (when that is possible). The example below will clear the url and edit the text, but leave everything else unchanged.

>>> banner.edit(text='New text here',url=None)
delete() bool[source]

Delete this banner.