20140117 (Friday, 17 January 2014)

Tidying up rstgen.sphinxconf

I didn’t checkin yesterday’s changes because one “detail” was missing: “sphinxcontrib.dailyblog” would have been the wrong name for this project. Because the “daily blog” things were in “sphinxcontrib.dailyblog.blog”. The name should rather have been something like “Luc’s Sphinx Extensions”.

But after a night of sleep I discovered another “detail”: if anyway the new project would always depend on atelier, why then split it into a separate project?

So I decided to undo most changes, i.e. to not move rstgen.sphinxconf into a separate module.

Only one change remains: atelier now supports namespace packages (and thus the fablib command fab summary no longer prints “old” and “new” version because that would require the Distribution object (returned from pkg_resources.get_distribution) which afaics makes problems for namespace packages.

And of course the thing which caused all these evolutions: the new refstothis directive, which I finally implemented in a new Sphinx extension module rstgen.sphinxconf.refstothis.

TODO: continue to tidy up. Opened new ticket docs/tickets/89.

The modules rstgen.sphinxconf.insert_input, rstgen.sphinxconf.dirtables, rstgen.sphinxconf.base and rstgen.sphinxconf.refstothis are now standalone Sphinx extensions.

New setting contacts.hide_region

A visitor of the Lino Così demo site had caused the following Internal Server Error:

AttributeError at /api/contacts/Persons
'Person' object has no attribute 'city_zip_code'

This bug occurred only for Partners with a non-empty region field. This is not yet well tested.

Until now, every lino_cosi.models did the following code:

@dd.when_prepared('contacts.Person', 'contacts.Company')
def hide_region(model):
    model.hide_elements('region')

Which made it basically impossible to run a “non-Belgian” Lino Così site.

Now this is done using the contacts.hide_region plugin setting, and Lino Così by default no longer hides the field.

I also tried to add the MergeAction unconditionally to every Person and Company, but that turned out to not be so easy. See docs/tickets/90.

TODO: The few_cities fixture doesn’t yet set the parent field for Eupen, Kettenis and other places.