eonvelope.templatetags.timezones module

Module with templatestags for timezone.

class eonvelope.templatetags.timezones.GetAvailableTimezonesNode(variable)[source]

Bases: Node

Node putting the output of zoneinfo.available_timezones() in the context.

Note

Analogous to django.templatetags.i18n.GetAvailableTimezonesNode().

Parameters:

variable (str)

__init__(variable)[source]

Constructor for the node.

Parameters:

variable (str)

Return type:

None

render(context)[source]

Adds available timezones to the context.

Parameters:

context (Context) – The template context.

Return type:

Literal['']

Returns:

The empty string

eonvelope.templatetags.timezones.do_get_available_timezones(parser, token)[source]

Store a list of available timezones in the context.

Usage:

{% get_available_timezones as timezones %}
{% for timezone in timezones %}
...
{% endfor %}

This puts zoneinfo.available_timezones() into the named variable.

Note

Analogous to django.templatetags.i18n.do_get_available_languages().

Return type:

GetAvailableTimezonesNode