Wednesday, March 4, 2015¶
Please specify a doctor type¶
When inserting a
aids.RefundConfirmation: Lino now says
Please specify a doctor type (“Bitte geben Sie die Art des
Arztes an”) if user leaves both doctor and doctor_type blank (instead
of raising an IntegrityError
'doctor_type_id' cannot be null")).
‘Role’ object has no attribute ‘language’¶
If the recipient of an aid confirmation is a
lino.modlib.contacts.models.Role, Lino no longer raises an
AttributeError “‘Role’ object has no attribute ‘language’”
Combinations of two¶
I started to work on #118. The first part is a general problem: how to find duplicate persons in a database. This is done by lino.modlib.dedupe, but until now it was just a proof of concept which needed to be optimized. That’s done now. See Avoiding duplicate clients.
not only persons but all partners
uses a new database field phonetic_name
Use a model mixin and override full_clean.
This is an example case where Django’s signals would cause a lot of trouble and hacking while overriding a model mixin and full_clean is elegant.
The optimized algorithem uses combinations:
>>> from itertools import combinations >>> [''.join(c) for c in combinations(['a', 'b'], 2)] ['ab'] >>> [''.join(c) for c in combinations(['a', 'b', 'c'], 2)] ['ab', 'ac', 'bc'] >>> [''.join(c) for c in combinations(['a', 'b', 'c', 'd'], 2)] ['ab', 'ac', 'ad', 'bc', 'bd', 'cd']