Monday, March 30, 2015

Moved Luc’s blog out of Lino

This is my first blog entry which will not go to the Lino repository. As part of the process of decentralizing the Lino development, I moved my blog out the Lino documentation tree. It is now available at Updated /docs/blog.

Creating countries

It was not possible to create new Country objects because these have a non-numeric primary key.

The type of the primary key

How to test whether an object’s model has a primary key which can be pointed to using a GenericForeignKey:

>>> import os
>>> os.environ['DJANGO_SETTINGS_MODULE'] = 'lino.projects.min1.settings.demo'
>>> from django.db import models
>>> from import *
>>> obj = countries.Country.objects.get(pk='BE')
<django.db.models.fields.CharField: isocode>
>>> GFK_TARGETS = (models.AutoField, models.IntegerField)
>>> isinstance(, GFK_TARGETS)
>>> isinstance(, GFK_TARGETS)

Duplicate humans

Two persons Norbert Berg and Norbert van Berg should be detected as similar, but Norbert van Berg and Lydia van Berg not

Extended lino.mixins.humans and lino_welfare.modlib.dupable_clients.mixins.DupableClient. Added test cases in /tutorials/human/index.