20130716 (Tuesday, 16 July 2013)

Expected a string, got 30L

When trying the Create Invoice action to faggio.sales.InvoiceablePartners on faggio-demo I got the above traceback. This was because Lino’s QuantityField.to_python implementation wasn’t yet robust enough. Here some test cases:

>>> from decimal import Decimal
>>> from lino import startup
>>> startup('lino_book.projects.min1.settings.demo')
>>> from lino.api import dd
>>> f = dd.QuantityField()
>>> f.to_python(None)
>>> f.to_python(30)
>>> f.to_python(30L)
>>> print f.to_python('')
>>> f.to_python(Decimal(0))

Events, Guests and Clients

I found a way for making workflows configurable. See

I replaced the fill_event_guests_from_team_members function (a receiver for the post_save signal on Event) by two methods lino.modlib.cal.Event.add_guests() and lino.modlib.cal.Event.suggest_guests(). Which shows that I prefer subclassing over signals for making these things customizable.

Then I applied the new ideas for inheriting apps to lino_welfare: New modules lino_welfare.modlib.cal, lino_welfare.modlib.contacts and lino_welfare.modlib.ui

Aha! And here is also another missing piece: lino.ad.app.extends_models instead of having to specify them in lino.ui.Site.override_modlib_models.


TODO: some tests are failing because lino.ui is no longer automatically being yeld by get_installed_apps.