2007-09-15 03:08:19 +08:00
|
|
|
"""
|
|
|
|
An alphabetical list of provinces and territories for use as `choices`
|
|
|
|
in a formfield., and a mapping of province misspellings/abbreviations to
|
|
|
|
normalized abbreviations
|
|
|
|
|
|
|
|
Source: http://www.canada.gc.ca/othergov/prov_e.html
|
|
|
|
|
|
|
|
This exists in this standalone file so that it's only imported into memory
|
|
|
|
when explicitly needed.
|
|
|
|
"""
|
2011-03-17 08:59:30 +08:00
|
|
|
import warnings
|
|
|
|
warnings.warn(
|
|
|
|
'There have been recent changes to the CA localflavor. See the release notes for details',
|
|
|
|
RuntimeWarning
|
|
|
|
)
|
2007-09-15 03:08:19 +08:00
|
|
|
|
|
|
|
PROVINCE_CHOICES = (
|
|
|
|
('AB', 'Alberta'),
|
|
|
|
('BC', 'British Columbia'),
|
|
|
|
('MB', 'Manitoba'),
|
|
|
|
('NB', 'New Brunswick'),
|
2011-03-17 08:59:30 +08:00
|
|
|
('NL', 'Newfoundland and Labrador'),
|
2007-09-15 03:08:19 +08:00
|
|
|
('NT', 'Northwest Territories'),
|
|
|
|
('NS', 'Nova Scotia'),
|
|
|
|
('NU', 'Nunavut'),
|
|
|
|
('ON', 'Ontario'),
|
|
|
|
('PE', 'Prince Edward Island'),
|
|
|
|
('QC', 'Quebec'),
|
|
|
|
('SK', 'Saskatchewan'),
|
2011-03-17 08:59:30 +08:00
|
|
|
('YT', 'Yukon')
|
2007-09-15 03:08:19 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
PROVINCES_NORMALIZED = {
|
|
|
|
'ab': 'AB',
|
|
|
|
'alberta': 'AB',
|
|
|
|
'bc': 'BC',
|
|
|
|
'b.c.': 'BC',
|
|
|
|
'british columbia': 'BC',
|
|
|
|
'mb': 'MB',
|
|
|
|
'manitoba': 'MB',
|
2007-11-30 02:15:46 +08:00
|
|
|
'nb': 'NB',
|
|
|
|
'new brunswick': 'NB',
|
2011-03-17 08:59:30 +08:00
|
|
|
'nf': 'NL',
|
|
|
|
'nl': 'NL',
|
|
|
|
'newfoundland': 'NL',
|
|
|
|
'newfoundland and labrador': 'NL',
|
2007-09-15 03:08:19 +08:00
|
|
|
'nt': 'NT',
|
|
|
|
'northwest territories': 'NT',
|
|
|
|
'ns': 'NS',
|
|
|
|
'nova scotia': 'NS',
|
|
|
|
'nu': 'NU',
|
|
|
|
'nunavut': 'NU',
|
|
|
|
'on': 'ON',
|
|
|
|
'ontario': 'ON',
|
|
|
|
'pe': 'PE',
|
|
|
|
'pei': 'PE',
|
|
|
|
'p.e.i.': 'PE',
|
|
|
|
'prince edward island': 'PE',
|
|
|
|
'qc': 'QC',
|
|
|
|
'quebec': 'QC',
|
|
|
|
'sk': 'SK',
|
|
|
|
'saskatchewan': 'SK',
|
2011-03-17 08:59:30 +08:00
|
|
|
'yk': 'YT',
|
|
|
|
'yt': 'YT',
|
|
|
|
'yukon': 'YT',
|
|
|
|
'yukon territory': 'YT',
|
2007-09-15 03:08:19 +08:00
|
|
|
}
|