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

lino.utils.addressable

See The lino.utils.addressable module.

Classes

Addressable()

General mixin (not only for Django models) to encapsulate the generating of "traditional" ("snail") mail addresses.

TestAddress(*lines)

Used only for testing.

class lino.utils.addressable.Addressable

Bases: object

General mixin (not only for Django models) to encapsulate the generating of “traditional” (“snail”) mail addresses.

Usable subclasses must implement at least address_person_lines() and address_location_lines().

address_person_lines()

Yield one or more text lines, one for each line of the person part.

address_location_lines()

Yield one or more text lines, one for each line of the location part.

get_address_lines()

Yield a series of text lines, one for each line of the address.

get_address(linesep='\n')

The plain text full postal address (person and location). Lines are separated by linesep, which defaults to a newline.

property address

The plain text full postal address (person and location). Lines are separated by linesep, which defaults to a newline.

get_address_html(*args, **kwargs)

Return the full postal address as a text containing simple html markup with a single paragraph (<p>).

property address_html

Return the full postal address as a text containing simple html markup with a single paragraph (<p>).

has_address()

Returns True if the address location is non empty.

class lino.utils.addressable.TestAddress(*lines)

Bases: Addressable

Used only for testing.