Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino_xl.lib.countries.utils

Utilities for lino_xl.lib.countries.

Defines models AddressFormatter and CountryDrivers.

Functions

get_address_formatter(country)

Return the address formatter (an AddressFormatter instance) for the given country.

Classes

AddressFormatter()

Format used in BE, DE, FR, NL...

BangladeshiAddressFormatter()

Format used in Bangladesh.

EstonianAddressFormatter()

Format used in Estonia.

PlaceGenerator()

class lino_xl.lib.countries.utils.AddressFormatter

Bases: object

Format used in BE, DE, FR, NL…

class lino_xl.lib.countries.utils.EstonianAddressFormatter

Bases: AddressFormatter

Format used in Estonia.

class lino_xl.lib.countries.utils.BangladeshiAddressFormatter

Bases: AddressFormatter

Format used in Bangladesh.

While using gis (with SITE.use_gis) we treat Unions as city types, which is convenient for resolving addresses from lowest admin level, and hence the formatter must treat city as Union so the get_city_lines yields empty string (“”) whereas get_street_line yields also the city field.

lino_xl.lib.countries.utils.get_address_formatter(country)

Return the address formatter (an AddressFormatter instance) for the given country.