Monday, March 23, 2015

Teaching takes time

Yesterday Mahmoud and I worked on #38, it was very interesting for us and good for Lino… but now I had another two hours of work for getting the test suite to pass again under Django 1.6 :-)

  • choicelist_choices used by the choicelist field of properties.PropType.

  • The ChoiceList.class_init we introduced yesterday forgot to call super.

Release in Eupen

Instead of increasing the version number and writing a migrator, I manually removed the following line in the restore.py file generated by that version of Lino:

# execfile("dupable_partners_word.py")

Uncommenting a line of code is less work that writing a migrator.

I also invoked this manually:

$ python manage.py check_plausibility
INFO Started manage.py check_plausibility (using ...) --> PID 21591
INFO This is Lino Welfare 1.1.21 using Lino 1.6.17, Django 1.6.5, Python 2.6.6, Babel 1.3, Jinja 2.7.2, Sphinx 1.2.2, python-dateutil 2.2, OdfPy ODFPY/0.9.6, docutils 0.11, suds 0.4, PyYaml 3.11, Appy 0.8.5 (2013/08/12 09:51).
INFO Languages: de, fr, nl. 48 apps, 118 models, 429 actors.
Running 1 checkdata checkers on 2781 Events...
[################################] 2781/2781 - 00:00:25
Found 1884 and fixed 0 plausibility problems in Events.
Running 1 plausibility checkers on 251 Households...
[################################] 251/251 - 00:00:00
Found 102 and fixed 0 plausibility problems in Households.
Running 1 plausibility checkers on 9 Course providers...
[################################] 9/9 - 00:00:00
Found 9 and fixed 0 plausibility problems in Course providers.
Running 1 plausibility checkers on 2838 Organisations...
[################################] 2838/2838 - 00:00:16
Found 2830 and fixed 0 plausibility problems in Organisations.
Running 7 plausibility checkers on 6870 Clients...
[################################] 6870/6870 - 00:03:07
Found 19333 and fixed 0 plausibility problems in Clients.
Running 1 plausibility checkers on 70 Job Providers...
[################################] 70/70 - 00:00:00
Found 69 and fixed 0 plausibility problems in Job Providers.
Running 1 plausibility checkers on 971 Places...
[################################] 971/971 - 00:00:00
Found 120 and fixed 0 plausibility problems in Places.
Running 1 plausibility checkers on 15928 Partners...
[################################] 15928/15928 - 00:01:29
Found 15196 and fixed 0 plausibility problems in Partners.
Running 1 plausibility checkers on 12858 Persons...
[################################] 12858/12858 - 00:01:15
Found 12322 and fixed 0 plausibility problems in Persons.
INFO Done manage.py check_plausibility (PID 21591)

New test case for duplicate clients

Our three concrete cases of duplicate clients in Eupen were still not detected due to a minor bug in find_similar_instances of DupableClient. Fixed the bug and wrote a test case test_dupe_clients to verify it.

Session with Mahmoud

Some notes during our next session.

I noticed that the term “django-admin command” in the Django documentation has been replaced by “django-admin command”. Seems that I must update the Lino documentation accordingly.

We discovered another black hole in the documentation: https://www.lino-framework.org/dev/site_config.html.

Mahmoud asked “Why do I need to pass this globals() when instantiating a SITE?”, and it took me more than a minute to find the answer in the documentation. And this answer then was not deep enough to be useful. The missing piece for him was that “global”, in Python means “per module” and not “per process”.

The big chain of imports of many subclasses of the lino.core.site.Site class can seem confusing. But it gives us a hierarchy of places where we can define and override attributes and methods of an application. For example:

Or: