Tuesday, April 15, 2014

Data migration and after_load

New method north.dpy.Migrator.after_load(). Data migrations should no longer do:

def f(loader):
    # do something after load
globals_dict.update(after_load=f)

But:

def f(loader):
    # do something after load
self.after_load(f)

Until now it was (theoretically) possible that the after_load method of one migration got overwritten by a next migration.

Converting Belgian NBANs to IBAN & BIC

New module lino.modlib.sepa.utils to convert a Belgian National Bank Account Number to the corresponding IBAN and BIC. We need this for data migration in docs/tickets/93. A first implementation used the free public SOAP service available at ibanbic.be. Unfortunately this turned out to be too slow when we need to convert thousands of NBANs. So I rewrote the whole thing based on my existing code from TIM, and using a hard-coded list of Belgian bank codes (taken from nbb.be).

Miscellaneous

I moved the badges app from lino.modlib to lino_welfare.modlib.