Calendar ======== Base class: :doc:`Part` A calendar component that renders a month-grid calendar. .. note:: This component is experimental. The API may change in future versions. Example: .. code-block:: python calendar = Calendar( auto__model=Album, event__attr='published_date', event__display_name=lambda event, **_: format_html( '', event.artist, event.name, event.name ), event__tag=None, year=1983, month=8, ) .. raw:: html
▼ Hide result
Toggle structure
Refinable members ----------------- `actions` ^^^^^^^^^ Type: `dict[str, Action]` Cookbook: :ref:`calendar-navigation` `after`     (:ref:`evaluated `) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `int | str` See :ref:`after ` `assets` ^^^^^^^^ Type: `Namespace` See :ref:`assets ` `attrs`     (:ref:`evaluated `) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: :doc:`Attrs` See :ref:`attributes ` `auto` ^^^^^^ Type: `CalendarAutoConfig` See :ref:`auto ` `day` ^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `day_number` ^^^^^^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `endpoints` ^^^^^^^^^^^ Type: `Namespace` See :ref:`endpoints ` `event` ^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-from-model` `extra` ^^^^^^^ Type: `dict[str, Any]` See :ref:`extra ` `extra_evaluated` ^^^^^^^^^^^^^^^^^ Type: `dict[str, Any]` See :ref:`extra ` `extra_params` ^^^^^^^^^^^^^^ See :ref:`extra_params ` `h_tag`     (:ref:`evaluated `) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `Fragment | str` See :ref:`title ` `include`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `bool` See :ref:`include <include>` `iommi_style` ^^^^^^^^^^^^^ Type: `str | Style | None` See :ref:`iommi_style <iommi_style>` `model`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `type[Model]` Cookbook: :ref:`calendar-from-model` `month`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `int` Cookbook: :ref:`calendar-from-model` `navigation` ^^^^^^^^^^^^ Type: `Namespace` Cookbook: :ref:`calendar-navigation` `other_month` ^^^^^^^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `rows`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cookbook: :ref:`calendar-from-model` `tag`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `str` Default: `table` See :ref:`tag <tag>` `template`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `str | Template` Default: `iommi/calendar/calendar.html` See :ref:`template <template>` `title`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `str | None` See :ref:`title <title>` `today` ^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `weekday` ^^^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `weekend` ^^^^^^^^^ Type: `CalendarCellConfig` Cookbook: :ref:`calendar-cell-styling` `year`     (:ref:`evaluated <evaluate>`) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Type: `int` Cookbook: :ref:`calendar-from-model` Methods ------- `as_view` ^^^^^^^^^ `days_for_month` ^^^^^^^^^^^^^^^^ Generate CalendarDay instances for each day in the calendar grid. `get_first_month_with_data` ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Return (year, month) of the earliest month that has data, or None. `get_first_with_data_url` ^^^^^^^^^^^^^^^^^^^^^^^^^ `get_last_month_with_data` ^^^^^^^^^^^^^^^^^^^^^^^^^^ Return (year, month) of the latest month that has data, or None. `get_last_with_data_url` ^^^^^^^^^^^^^^^^^^^^^^^^ `get_month_name` ^^^^^^^^^^^^^^^^ `get_next_month` ^^^^^^^^^^^^^^^^ `get_next_month_with_data` ^^^^^^^^^^^^^^^^^^^^^^^^^^ Return (year, month) of the closest later month that has data, or None. `get_next_url` ^^^^^^^^^^^^^^ `get_next_with_data_url` ^^^^^^^^^^^^^^^^^^^^^^^^ `get_prev_month` ^^^^^^^^^^^^^^^^ `get_prev_month_with_data` ^^^^^^^^^^^^^^^^^^^^^^^^^^ Return (year, month) of the closest earlier month that has data, or None. `get_prev_url` ^^^^^^^^^^^^^^ `get_prev_with_data_url` ^^^^^^^^^^^^^^^^^^^^^^^^ `get_today_url` ^^^^^^^^^^^^^^^ `get_weekday_names` ^^^^^^^^^^^^^^^^^^^ `on_bind` ^^^^^^^^^ `on_refine_done` ^^^^^^^^^^^^^^^^ `own_evaluate_parameters` ^^^^^^^^^^^^^^^^^^^^^^^^^ `weeks_for_month` ^^^^^^^^^^^^^^^^^ Generate weeks (lists of 7 CalendarDay instances) for the calendar grid.