Welcome | Get started | Dive into Lino | Contribute | Topics | Reference | More

calview : Calendar view

The lino_xl.lib.calview plugin adds a calendar view.

This page is a tested document and the following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_book.projects.avanti1.settings')
>>> from lino.api.doctest import *

Calendar views

class lino_xl.lib.calview.CalendarView

Base class for all calendar views.

A calendar view is a virtual table that opens in detail view by default, the grid view is useless.

The detail of a calendar view varies, but it usually shows at least one slave table, which is usually a subclass of DaySlave.

class lino_xl.lib.calview.DailyView

Shows a calendar navigator with a configurable daily view.

Inherits from CalendarView.

insert_event

Custom action for inserting a calendar entry in the DailyView.

Returns an eval_js that equates to running the insert window action for Events with the correct known values.

class lino_xl.lib.calview.WeeklyView

Shows a calendar navigator with a configurable weekly view.

Inherits from CalendarView.

class lino_xl.lib.calview.MonthlyView

Shows a calendar navigator with a configurable monthly view.

Inherits from CalendarView.

The daily planner

The daily planner is a table that shows an overview on all events of a day.

>>> rt.show(calview.DailyPlanner)
... 
============ ================================================================================================================================================================================================================================================================================================================================================================================================================================================================ ==========
 Time range   External                                                                                                                                                                                                                                                                                                                                                                                                                                                         Internal
------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------
 *All day*    <em><div style="overflow: hidden; height: 1.2em;padding: 0 5px" pk="269"><span CLASS="dot" style="overflow: hidden; background-color: Blue; color: white; "> </span><span> ☒ romain Absent for private reasons</span></div></em><em><div style="overflow: hidden; height: 1.2em;padding: 0 5px" pk="270"><span CLASS="dot" style="overflow: hidden; background-color: Blue; color: white; "> </span><span> ☑ rolf Absent for private reasons</span></div></em>
 *AM*         <em><div style="overflow: hidden; height: 1.2em;padding: 0 5px" pk="239"><span CLASS="dot" style="overflow: hidden; background-color: Blue; color: white; "> </span><span>08:30 ☑ romain Réunion</span></div></em>
 *PM*
============ ================================================================================================================================================================================================================================================================================================================================================================================================================================================================ ==========
class lino_xl.lib.calview.DailyPlanner

The virtual table used to render the daily planner.

class lino_xl.lib.calview.PlannerColumns

A choicelist that defines the columns to appear in the daily planner. This list can be modified locally.

A default configuration has two columns in the daily planner:

>>> rt.show(calview.PlannerColumns)
======= ========== ==========
 value   name       text
------- ---------- ----------
 10      external   External
 20      internal   Internal
======= ========== ==========
class lino_xl.lib.calview.DailyPlannerRow

A database object that represents one row of the daily planner. The default configuration has "AM", "PM" and "All day".

>>> rt.show(calview.DailyPlannerRows)
===== ============= ================== ================== ============ ==========
 No.   Designation   Designation (de)   Designation (fr)   Start time   End time
----- ------------- ------------------ ------------------ ------------ ----------
 1     AM            Vormittags         Avant-midi                      12:00:00
 2     PM            Nachmittags        Après-midi         12:00:00
===== ============= ================== ================== ============ ==========

Utilities

class lino_xl.lib.calview.Day

An in-memory wrapper around a datetime.date instance.

A subclass of lino.core.fields.TableRow.

date
pk
ar
navigation_mode
class lino_xl.lib.calview.DaySlave

Table mixin for slave tables of tables on Day.

Used by both database and virtual tables.

class lino_xl.lib.calview.DayNavigator

Base class for the three calendar views, but also used for independent tables like working.WorkedHours. A virtual table whose rows are calview.Day instances. Subclasses must set navigation_mode.

Inherits from DaysTable.

Class inheritance

Inheritance diagram of lino_xl.lib.calview.ui.DailyView, lino_xl.lib.calview.ui.WeeklyView, lino_xl.lib.calview.ui.MonthlyView
Inheritance diagram of lino_xl.lib.calview.ui.DailySlave, lino_xl.lib.calview.ui.WeeklySlave, lino_xl.lib.calview.ui.MonthlySlave

Multiple "planners"

>>> rt.show(calview.Planners)
========= ========= ========== ===================== ==================== ===================
 value     name      text       Monthly view          Weekly view          Daily view
--------- --------- ---------- --------------------- -------------------- -------------------
 default   default   Calendar   calview.MonthlyView   calview.WeeklyView   calview.DailyView
========= ========= ========== ===================== ==================== ===================