====================== Friday, March 13, 2015 ====================== Repairable data =============== (Continued from yesterday.) I applied the new feature :mod:`lino.mixins.repairable` to :mod:`lino.modlib.addresses` : :meth:`get_primary_address ` no longer has an "optional side effect", but that functionality is now in :meth:`AddressOwner.get_repairable_problems `. And also :mod:`lino_xl.lib.cal` now detects repairable data: :meth:`cal.Event.get_repairable_problems `. Note that when :meth:`AddressOwner.get_repairable_problems ` detects some repairable data, e.g. :message:`Unique address is not marked primary.`, then :manage:`repairdata` it will usually report this message several times: a first time for the :class:`Partner `, another time for the :class:`Person ` or :class:`Company `. Yearly index page of a daily blog ================================= A little change in :mod:`rstgen.sphinxconf.blog`: the toctree of the yearly index page (:rst:dir:`blogger_year`) is no longer hidden. Dupables are now repairable =========================== This is one of the situations which make me love Lino: after finishing with the "Repairable data" topic (mostly needed for Chatelet, and Eupen started to ask impatiently what I am doing), I turned back to Eupen who want to find their dupable partners. And what do I see? I see this code at the end of :mod:`lino.mixins.dupable`:: def update_all_dupable_words(): """To be called after initializing a demo database, e.g. from `lino_welfare.fixtures.demo2`. """ raise Exception("Not yet used. Maybe once as an action on SiteConfig.") for m in settings.SITE.models_by_base(Dupable): for obj in m.objects.all(): obj.update_dupable_words() All this is no longer necessary because now we have the :manage:`repairdata` command! I just needed to write a :meth:`lino.mixins.dupable.Dupable.get_repairable_problems` method.