Wednesday, January 25, 2017

Upgrade on Die Eiche

A quick routine upgrade which required a snapshot & restore, but no explicit data migration.

I used the following a trick for checking whether the database needs migration or not:

  • Make a snapshot:

    $ ./
  • Update the code repositories:

    $ ./
  • run dump2py into a temporary directory:

    $ python dump2py -o t
  • If there is an error (e.g. today I had a OperationalError: (1054, "Unknown column 'cal_eventtype.max_days' in 'field list'"), then you need to run the of your snapshot:

    $ python run snapshot/

I quickly fixed #1422 en passant (or at least one part of the request: the free_places column is now an IntegerField and therefore right-aligned)

Moving translations from one package to another

I did inv mm in every project and ran the test suite once more, and it seems that the translations have correctly been moved from welfare to xl (after #1421).

When you move some code from one package to another (e.g. from a to b) :

  • run inv mm in both projects before starting

  • Move the code. Get it more or less running, but don’t worry for the test suite.

  • With your editor, manually copy the content of the django.po file of every language from project a and paste it to the end of its equivalent file in b. Do not copy the header fields.

  • run inv mm again in both projects

Preparing a demo on Thursday

Gerd and Mathieu will give a demo of Lino Welfare on Thursday. I did a last upgrade of the online demos.

  • The symbol used by ActorItem.render for representing the button which opens a dashboard item in its own window is no longer 🗗 but ⍐. The problem with the former was that it is not yet supported on many browsers.

More Avanti

I continued to work on the Lino Avanti prototype (#1400).

The households module has a cool feature: you can enter members by either (1) selecting an existing client or (2) manually entering their names, birth date and sex. And when you enter all four manual fields (first name, last name, birth date and sex) for a member, then Lino automatically creates a client for that member and links them.

This feature is probably important for Lino Avanti. I think that Johanna will want the humanlinks and households modules (although their first reaction in our meeting was different).

I now realized that this feature was only in the Lino Welfare version. So I moved it to lino_xl and left only some really PCSW-specific things in lino_welfare.modlib.hourseholds.

This change caused an interesting failure in households. That was because household memberships automatically create human links when necessary, and new households are automatically populated from the children of the head of households and her or his partner.