20140405 (Saturday, 05 April 2014)

custom fields

When manually entering IBAN and BIC fields, users can now type lowercase characters. These are automatically converted to uppercase.

This was not trivial.

One problem with a first (internal) implementation was that it made the whole framework depend on django-iban . django-iban is very good, but only people who use lino.modlib.sepa will want to install it.

To solve this, I added a new feature to Lino: apps can now define their own custom fields. This is of course just an extension to Django’s philosophy. For Lino we just needed to add a CustomField.

Usage example see UppercaseTextField and its subclasses IBANField and SWIFTBICField.

The problem of the change and afteredit events remains. In fact the EditorGridPanel needs a thorough revision. But for the moment we can continue to live with a workaround: added a to_python method to UppercaseTextField.