Notes

A tested document

This is a tested document. The following instructions are used for initialization:

>>> from lino import startup
>>> startup('lino_welfare.projects.gerd.settings.doctests')
>>> from lino.api.doctest import *
>>> translation.activate("en")

The first meeting

We can use the lino_welfare.modlib.pcsw.Client.get_first_meeting() method for getting the last note about a given client and of given type.

>>> from django.utils.translation import ugettext_lazy as _
>>> flt = dd.str2kw("name", _("First meeting"))
>>> fm = rt.models.notes.NoteType.objects.get(**flt)
>>> ses = rt.login('rolf')
>>> ses.show(notes.NotesByType, fm, column_names="id project")
===== =========================================
 ID    Klient
----- -----------------------------------------
 26    ERNST Berta (125)
 37    EVERTZ Bernd (126)
 48    AUSDEMWALD Alfons (116)
 59    BASTIAENSEN Laurent (117)
 70    COLLARD Charlotte (118)
 81    CHANTRAINE Marc (120*)
 92    DERICUM Daniel (121)
 103   DEMEULENAERE Dorothée (122)
 114   DOBBELSTEIN-DEMEULENAERE Dorothée (123)
 16    JEANÉMART Jérôme (181)
 17    VANDENMEULENBOS Marie-Louise (174)
 14    DUBOIS Robin (179)
 15    LAHM Lisa (176)
 13    DENON Denis (180*)
 12    JEANÉMART Jérôme (181)
 11    KASENNOVA Tatjana (213)
===== =========================================

Client 125 has a first meeting, while client 124 doesn’t:

>>> rt.models.pcsw.Client.objects.get(pk=125).get_first_meeting()
Note #26 ('Ereignis/Notiz #26')
>>> rt.models.pcsw.Client.objects.get(pk=124).get_first_meeting()

The first meeting is also printed on a debts mediation budget. See The first meeting of a budget.