Latvia (lv)

Added in version 1.1.

Forms

class localflavor.lv.forms.LVMunicipalitySelect(attrs=None)[source]

A select field of Latvian municipalities.

class localflavor.lv.forms.LVPersonalCodeField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

A form field that validates input as a Latvian personal code.

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

static lv_checksum(value)[source]

Takes a string of 10 digits as input, returns check digit.

class localflavor.lv.forms.LVPostalCodeField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

A form field that validates and normalizes Latvian postal codes.

Latvian postal codes in following forms accepted:
  • XXXX

  • LV-XXXX

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

Data

localflavor.lv.lv_choices.MUNICIPALITY_CHOICES = (('DGV', 'Daugavpils'), ('JEL', 'Jelgava'), ('JUR', 'Jūrmala'), ('LPX', 'Liepāja'), ('REZ', 'Rēzekne'), ('RIX', 'Riga'), ('VEN', 'Ventspils'), ('002', 'Aizkraukle municipality'), ('007', 'Alūksne municipality'), ('011', 'Ādaži municipality'), ('015', 'Balvi municipality'), ('016', 'Bauska municipality'), ('022', 'Cēsis municipality'), ('026', 'Dobele municipality'), ('033', 'Gulbene municipality'), ('041', 'Jelgava municipality'), ('042', 'Jēkabpils municipality'), ('047', 'Krāslava municipality'), ('050', 'Kuldīga municipality'), ('052', 'Ķekava municipality'), ('054', 'Limbaži municipality'), ('056', 'Līvāni municipality'), ('058', 'Ludza municipality'), ('059', 'Madona municipality'), ('062', 'Mārupe municipality'), ('067', 'Ogre municipality'), ('068', 'Olaine municipality'), ('073', 'Preiļi municipality'), ('077', 'Rēzekne municipality'), ('080', 'Ropaži municipality'), ('087', 'Salaspils municipality'), ('088', 'Saldus municipality'), ('089', 'Saulkrasti municipality'), ('091', 'Sigulda municipality'), ('094', 'Smiltene municipality'), ('097', 'Talsi municipality'), ('099', 'Tukums municipality'), ('101', 'Valka municipality'), ('102', 'Varakļāni municipality'), ('106', 'Ventspils municipality'), ('111', 'Augšdaugava municipality'), ('112', 'Dienvidkurzeme municipality'), ('113', 'Valmiera municipality'))

A list of Latvian municipalities and republican cities. Identifiers based on ISO 3166-2:LV. https://en.wikipedia.org/wiki/ISO_3166-2:LV