Switzerland (ch
)¶
Forms¶
Swiss-specific Form helpers.
- class localflavor.ch.forms.CHIdentityCardNumberField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]¶
A Swiss identity card number.
Checks the following rules to determine whether the number is valid:
Conforms to the X1234567<0 or 1234567890 format.
Included checksums match calculated checksums
- class localflavor.ch.forms.CHSocialSecurityNumberField(*, max_length=None, min_length=None, strip=True, empty_value='', **kwargs)[source]¶
A Swiss Social Security number (also known as the new AHV Number).
Checks the following rules to determine whether the number is valid:
Conforms to the 756.XXXX.XXXX.XX
Included checksums match calculated checksums
See: http://de.wikipedia.org/wiki/Sozialversicherungsnummer#Versichertennummer
Added in version 1.2.
- class localflavor.ch.forms.CHStateSelect(attrs=None)[source]¶
A Select widget that uses a list of CH states as its choices.
- class localflavor.ch.forms.CHZipCodeField(**kwargs)[source]¶
A form field that validates input as a Swiss zip code.
Valid codes consist of four digits ranging from 1XXX to 9XXX.
See: http://en.wikipedia.org/wiki/Postal_codes_in_Switzerland_and_Liechtenstein
Data¶
- localflavor.ch.ch_states.STATE_CHOICES = (('AG', 'Aargau'), ('AI', 'Appenzell Innerrhoden'), ('AR', 'Appenzell Ausserrhoden'), ('BS', 'Basel-Stadt'), ('BL', 'Basel-Land'), ('BE', 'Berne'), ('FR', 'Fribourg'), ('GE', 'Geneva'), ('GL', 'Glarus'), ('GR', 'Graubuenden'), ('JU', 'Jura'), ('LU', 'Lucerne'), ('NE', 'Neuchatel'), ('NW', 'Nidwalden'), ('OW', 'Obwalden'), ('SH', 'Schaffhausen'), ('SZ', 'Schwyz'), ('SO', 'Solothurn'), ('SG', 'St. Gallen'), ('TG', 'Thurgau'), ('TI', 'Ticino'), ('UR', 'Uri'), ('VS', 'Valais'), ('VD', 'Vaud'), ('ZG', 'Zug'), ('ZH', 'Zurich'))¶
An alphabetical list of states