Monday, January 23, 2017

A new Lino application is born ;-) It’s name is Lino Avanti. I had been working on it since Thursday and now published it:

Lino Avanti caused some changes to existing projects:

  • I moved CivilStates and ResidenceTypes from lino_welfare.modlib.pcsw to lino_xl.lib.beid. (The biggest challenge there is to not lose the translations).

  • New method lino.core.plugin.Plugin.on_site_init() used by lino_xl.lib.beid.Plugin to instantiate its holder_model.

  • lino_xl.lib.notes now supports being used without contacts.

  • Fixed a bug in lino.core.site.Site.is_abstract_model() which caused it to fail on plugins without their own Plugin class definition.

  • I moved lino_cosi.lib.courses to lino_xl.lib.courses, and this plugin now works when contacts is not installed.

  • lino_xl.lib.countries.mixins.AddressLocation now inherits from lino.utils.addressable.Addressable

  • We now have two mixins lino.mixins.Contactable and lino.mixins.Phonable. lino.modlib.users.models.User now inherits from the latter.

  • One user type can now have more than one role. This makes it easier to define the user types of an application. This required a backwards-incompatible API change: code of the following style must get adapted.

    Before:

     if isinstance(p.role, OfficeUser):
    
    After::
    
     if p.has_required_roles([OfficeUser]):
    
  • In lino.core.roles.UserRole I renamed has_required_roles() to satisfies_requirement.

  • lino_xl.lib.excerpts no longer needs lino_xl.lib.outbox (AFAIK nobody uses the outbox module).

  • I renamed lino_welfare.modlib.courses to lino_welfare.modlib.xcourses.

  • I removed usage of past.builtins after stumbling once more over #1296. The problem is still there, but I documented its workaround.

  • cv.LanguageKnowledgesByPerson now has a summary view. This change will have influence in Lino Welfare (and I guess that they will like it).

  • I wrote lino_avanti.lib.courses, but currently it isn’t used… and maybe I’ll throw it away. Such things happen constantly in this phase of a project. While I am programming things, I am in email contact with Johanna, asking her questions for analyzing their need.

Some changes in today’s commits are rather side effects:

Some specs about Avanti:

  • Ansprechpartner ÖSHZ and Soziale Kontakte könnten als “Klientenkontakte” gemacht werden.

  • Kursanbieter und Lehrer : in einer ersten Version werde ich lediglich in Konfiguration ‣ Kalender ‣ Räume die Kursanbieter als Räume erfassen.

  • Die Lehrer (Kursleiter) werden momentan als Benutzer erfasst. Für Lino ist eigentlich nicht wichtig, wer den Kurs tatsächlich gibt, sondern wer sich um das Erfassen der Anwesenheiten kümmert.

  • the calendar module is needed for registering the presences at courses

  • they use tickets, bot not clocking

En passant I fixed two tickets for Lino Voga: #1417 and #1419. For the former (#1417) I did a change which will also require changes in Lino Welfare:

  • I removed the virtual column info because it was functionally redundant with get_overview_elems().

And the second ticket revealed a bug which had been living for a long time in lino.modlib.extjs.ext_renderer. At first I suspected the cause somewhere in setup_quicklink(), that’s why I optimized the API for lino.core.site.Site.setup_quicklink() (it is called with a user parameter and no longer with the action request. This is in preparation for #1420.

The actual culprit was window_action_button. It had the following signature:

def window_action_button(
        self, ar, ba, status={},
        label=None, title=None, **kw):

and then it passed the status dict to action_call() which modified that dict!

It’s a well-known pitfall: you may not modify the dict specified as default value in a signature because your modification will modify the default value itself. The result was a magic behaviour because my quicklink was generated correctly only once during the first request after a server reload, and for all remaining calls it had a { record_id: -999998 } value.

The Lino Welfare test suite is still broken, I am going to repair it tomorrow.