Norway (no)


Norwegian-specific Form helpers.

class*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]

A form field for Norwegian bank account numbers.

Performs MOD11 with the custom weights for the Norwegian bank account numbers, including a check for a remainder of 0, in which event the checksum is also 0.

Usually their string representation is along the lines of ZZZZ.YY.XXXXX, where the last X is the check digit. They’re always a total of 11 digits long, with 10 out of these 11 being the actual account number itself.

  • Accepts, and strips, account numbers with extra spaces.
  • Accepts, and strips, account numbers provided in form of XXXX.YY.XXXXX.


No consideration is taking for banking clearing numbers as of yet, seeing as these are only used between banks themselves.

New in version 1.5.


Return a string.


A Select widget that uses a list of Norwegian municipalities (fylker) as its choices.

class*, required=True, widget=None, label=None, initial=None, help_text='', error_messages=None, show_hidden_initial=False, validators=(), localize=False, disabled=False, label_suffix=None)[source]

Algorithm is documented at


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

class*args, **kwargs)[source]

A form field that validates input as a Norwegian zip code.

Valid codes have four digits.

Data = (('akershus', 'Akershus'), ('austagder', 'Aust-Agder'), ('buskerud', 'Buskerud'), ('finnmark', 'Finnmark'), ('hedmark', 'Hedmark'), ('hordaland', 'Hordaland'), ('janmayen', 'Jan Mayen'), ('moreogromsdal', 'Møre og Romsdal'), ('nordtrondelag', 'Nord-Trøndelag'), ('nordland', 'Nordland'), ('oppland', 'Oppland'), ('oslo', 'Oslo'), ('rogaland', 'Rogaland'), ('sognogfjordane', 'Sogn og Fjordane'), ('svalbard', 'Svalbard'), ('sortrondelag', 'Sør-Trøndelag'), ('telemark', 'Telemark'), ('troms', 'Troms'), ('vestagder', 'Vest-Agder'), ('vestfold', 'Vestfold'), ('ostfold', 'Østfold'))

An alphabetical list of Norwegian municipalities (fylker) for use as choices in a formfield.