Norway (no)


Norwegian-specific Form helpers.

class*args, **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.


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

class, min_length=None, *args, **kwargs)[source]

Field with phonenumber validation.

Requires a phone number with 8 digits and optional country code

Deprecated since version 1.4: Use the django-phonenumber-field library instead.

class, 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

class, min_length=None, *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.