patrols (Patrols main plugin)¶
A tested document¶
This is a tested document. The following instructions are used for initialization:
>>> from lino_patrols.projects.patrols1.startup import *
The patrols planner¶
The patrols planner is the central main feature of Lino Patrols. This is where most of the users spend most of their time.
>>> reset_sql_queries()
>>> rt.show(patrols.PatrolsPlanner, max_width=20, limit=7, readonly=True)
...
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| Date | 10 (Bot-MdP) | 20 (BM-FP-TB-MT-W) | 30 (BM-FP-VP-B) | 40 (Bayehon) | 50 (Warche) | 60 (Noire Eau) | 70 (Vélo) | 99 (etc) |
+======================+======================+======================+======================+======================+======================+======================+======================+======================+
| `Saturday, 28 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Sunday, 29 March | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) |
| 2026 <…>`__ | Eberhart Evers | Johann Johnen `13:00 | Marie-Louise Meier | Ulrike Charlier | Luc Faymonville | Jan Jousten `13:00 | Romain Raffault | Dorothée |
| | `13:00 <…>`__ (1/3) | <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | <…>`__ (1/3) Daniel | `13:00 <…>`__ (1/3) | Demeulenaere `13:00 |
| | Robin Rood | Dorothée Dobbelstein | Hildegard Hilgers | Line Lazarus | Andreas Arens | Emonts | Jacqueline Jacobs | <…>`__ (1/3) Marc |
| | | | | | | | | Malmendier |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Monday, 30 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Tuesday, 31 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ `Drapeau | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
| rouge <…>`__ | | | | | | | | |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Wednesday, 1 April | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) |
| 2026 <…>`__ | Bernd Evertz `13:00 | Josef Jonas `13:00 | Michael Mießen | Charlotte Collard | Germaine Gernegroß | Karl Kaivers `13:00 | Rolf Rompen `13:00 | Daniel Dericum |
| | <…>`__ (1/3) Hans | <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | <…>`__ (1/3) Edgar | <…>`__ (1/3) Jérémy | `13:00 <…>`__ (1/3) |
| | Altenberg | Dorothée | Irene Ingels | Josefine Leffin | Annette Arens | Engels | Jansen | Melissa Meessen |
| | | Dobbelstein- | | | | | | |
| | | Demeulenaere | | | | | | |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Thursday, 2 April | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Friday, 3 April | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ `Good | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
| Friday <…>`__ | | | | | | | | |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
This causes 14 SQL requests in cal.Event : 7 rows, each doing one request for the warnings of each day, the other for the patrol events. There are 7*8*2 = 112 events being displayed. For each event there is an SQL request to cal_guest.
>>> show_sql_summary()
===================== =========== =======
table stmt_type count
--------------------- ----------- -------
cal_event SELECT 14
cal_eventtype SELECT 114
cal_guest SELECT 112
cal_recurrentevent SELECT 1
courses_course SELECT 112
django_content_type SELECT 2
system_siteconfig SELECT 1
users_user SELECT 1
===================== =========== =======
>>> rt.show(patrols.PatrolsPlanner, display_mode="list", limit=7, readonly=True)
...
- # [Saturday, 28 March 2026](…)
### | 10 (Bot-MdP)
| [10:00](…) (0/3)
[13:00](…) (0/3)
...
- # [Sunday, 29 March 2026](…)
...
- # [Friday, 3 April 2026](…)
[Good Friday](…)
...
### | 99 (etc)
| [10:00](…) (0/3)
[13:00](…) (0/3)
The patrols history¶
This is like the patrols planner, except that it goes into the past.
>>> rt.show(patrols.PatrolsHistory, max_width=20, readonly=True, limit=7)
...
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| Date | 10 (Bot-MdP) | 20 (BM-FP-TB-MT-W) | 30 (BM-FP-VP-B) | 40 (Bayehon) | 50 (Warche) | 60 (Noire Eau) | 70 (Vélo) | 99 (etc) |
+======================+======================+======================+======================+======================+======================+======================+======================+======================+
| `Sunday, 22 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Monday, 23 March | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) |
| 2026 <…>`__ | Daniel Emonts `13:00 | Jacqueline Jacobs | Marc Malmendier | Alfons Ausdemwald | Eberhart Evers | Johann Johnen `13:00 | Marie-Louise Meier | Ulrike Charlier |
| | <…>`__ (1/3) Romain | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) |
| | Raffault | Dorothée | Gregory Groteclaes | Guido Lambertz | Robin Rood | Dorothée Dobbelstein | Hildegard Hilgers | Line Lazarus |
| | | Demeulenaere | | | | | | |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Tuesday, 24 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Wednesday, 25 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Thursday, 26 March | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) | `10:00 <…>`__ (1/3) |
| 2026 <…>`__ | Edgar Engels `13:00 | Jérémy Jansen `13:00 | Melissa Meessen | Laurent Bastiaensen | Bernd Evertz `13:00 | Josef Jonas `13:00 | Michael Mießen | Charlotte Collard |
| | <…>`__ (1/3) Rolf | <…>`__ (1/3) Daniel | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) | <…>`__ (1/3) Hans | <…>`__ (1/3) | `13:00 <…>`__ (1/3) | `13:00 <…>`__ (1/3) |
| | Rompen | Dericum | Henri Hilgers | Laura Laschet | Altenberg | Dorothée | Irene Ingels | Josefine Leffin |
| | | | | | | Dobbelstein- | | |
| | | | | | | Demeulenaere | | |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Friday, 27 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
| `Saturday, 28 March | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) | `10:00 <…>`__ (0/3) |
| 2026 <…>`__ | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) | `13:00 <…>`__ (0/3) |
+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
Notification options¶
>>> ar = rt.login('robin')
>>> ar.show("notify.MyOptions", ar.get_user(), language="fr")
==================== =============
Type de message Me notifier
-------------------- -------------
Rappels calendrier Oui
Modifications Non
Messages système Oui
==================== =============