Germany (de)

Forms

DE-specific Form helpers.

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

A German identity card number.

Checks the following rules to determine whether the number is valid:

  • Conforms to the XXXXXXXXXXX-XXXXXXX-XXXXXXX-X format.
  • No group consists entirely of zeroes.
  • Included checksums match calculated checksums

Algorithm is documented at http://de.wikipedia.org/wiki/Personalausweis

clean(value)[source]

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

class localflavor.de.forms.DEStateSelect(attrs=None)[source]

A Select widget that uses a list of DE states as its choices.

class localflavor.de.forms.DEZipCodeField(**kwargs)[source]

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

Valid zip codes consist of five digits.

Data

localflavor.de.de_states.STATE_CHOICES = (('BW', 'Baden-Wuerttemberg'), ('BY', 'Bavaria'), ('BE', 'Berlin'), ('BB', 'Brandenburg'), ('HB', 'Bremen'), ('HH', 'Hamburg'), ('HE', 'Hessen'), ('MV', 'Mecklenburg-Western Pomerania'), ('NI', 'Lower Saxony'), ('NW', 'North Rhine-Westphalia'), ('RP', 'Rhineland-Palatinate'), ('SL', 'Saarland'), ('SN', 'Saxony'), ('ST', 'Saxony-Anhalt'), ('SH', 'Schleswig-Holstein'), ('TH', 'Thuringia'))

An alphabetical list of states