Calendar¶
Base class: Part
A calendar component that renders a month-grid calendar.
Note
This component is experimental. The API may change in future versions.
Example:
calendar = Calendar(
auto__model=Album,
event__attr='published_date',
event__display_name=lambda event, **_: format_html(
'<img src="/_static/album_art/{}/{}.jpg" width="30" height="30" title="{}">',
event.artist,
event.name,
event.name
),
event__tag=None,
year=1983,
month=8,
)
Refinable members¶
actions¶
Type: dict[str, Action]
after (evaluated)¶
Type: int | str
See after
assets¶
Type: Namespace
See assets
attrs (evaluated)¶
Type: Attrs
See attributes
auto¶
Type: CalendarAutoConfig
See auto
day¶
Type: CalendarCellConfig
- Cookbook:
day_number¶
Type: CalendarCellConfig
- Cookbook:
endpoints¶
Type: Namespace
See endpoints
event¶
Type: CalendarCellConfig
extra¶
Type: dict[str, Any]
See extra
extra_evaluated¶
Type: dict[str, Any]
See extra
extra_params¶
See extra_params
h_tag (evaluated)¶
Type: Fragment | str
See title
include (evaluated)¶
Type: bool
See include
iommi_style¶
Type: str | Style | None
See iommi_style
model (evaluated)¶
Type: type[Model]
month (evaluated)¶
Type: int
other_month¶
Type: CalendarCellConfig
- Cookbook:
rows (evaluated)¶
tag (evaluated)¶
Type: str
- Default:
table See tag
template (evaluated)¶
Type: str | Template
- Default:
iommi/calendar/calendar.html See template
title (evaluated)¶
Type: str | None
See title
today¶
Type: CalendarCellConfig
- Cookbook:
weekday¶
Type: CalendarCellConfig
- Cookbook:
weekend¶
Type: CalendarCellConfig
- Cookbook:
year (evaluated)¶
Type: int
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.