Welcome | Get started | Dive into Lino | Contribute | Reference


See countries : Countries and cities.


Utilities for lino_xl.lib.countries.


The fixtures for lino_xl.lib.countries.


Plugin(site, app_label, app_name, ...)

The countries plugin.

class lino_xl.lib.countries.Plugin(site, app_label, app_name, app_module, needed_by, configs: dict)

Bases: Plugin

The countries plugin.

allow_duplicate_cities = False

In a default configuration (when allow_duplicate_cities is False), Lino declares a UNIQUE clause for Places to make sure that your database never contains duplicate cities. This behaviour might disturb e.g. when importing legacy data that did not have this restriction. Set it to True to remove the UNIQUE clause.

Changing this setting affects your database schema.

hide_region = False

Whether to hide the region field in postal addresses. Set this to True if you live in a country like Belgium. Belgium is --despite their constant language disputes-- obviously a very united country since they don't need a region field when entering a postal address. In Belgium, when you write a letter, you just say the zip code and name of the city. In many other countries there is a mandatory intermediate field.

region_label = 'County'

The verbose_name of the region field.

country_code = 'BE'

The 2-letter ISO code of the country where the site owner is located. This may not be empty, and there must be a country with that ISO code in lino_xl.lib.countries.models.Country.

municipality_type = '50'

The place type to be considered as administrativ municipality.

See lino_xl.lib.courses.CountryCity.municipality


Return the Country instance configured by country_code.