Switzerland (ch)¶
Forms¶
Swiss-specific Form helpers
- class localflavor.ch.forms.CHIdentityCardNumberField(required=True, widget=None, label=None, initial=None, help_text='', error_messages=None, show_hidden_initial=False, validators=, []localize=False)[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.CHPhoneNumberField(required=True, widget=None, label=None, initial=None, help_text='', error_messages=None, show_hidden_initial=False, validators=, []localize=False)[source]¶
Validate local Swiss phone number (not international ones) The correct format is ‘0XX XXX XX XX’. ‘0XX.XXX.XX.XX’ and ‘0XXXXXXXXX’ validate but are corrected to ‘0XX XXX XX XX’.
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