Code

Ticket #5523: uklocalflavor.diff

File uklocalflavor.diff, 4.2 KB (added by DavidReynolds, 7 years ago)

Diff to add the localflavor for uk

Line 
1Index: django/contrib/localflavor/uk/uk_counties.py
2===================================================================
3--- django/contrib/localflavor/uk/uk_counties.py        (revision 0)
4+++ django/contrib/localflavor/uk/uk_counties.py        (revision 0)
5@@ -0,0 +1,112 @@
6+"""
7+Source: http://www.statistics.gov.uk/geography/downloads/31_10_01_County_names_and_codes_12_00.xls
8+"""
9+
10+ENGLAND_COUNTY_CHOICES = (
11+    ("Greater London", "Greater London"),
12+    ("Greater Manchester", "Greater Manchester"),
13+    ("Merseyside", "Merseyside"),
14+    ("South Yorkshire", "South Yorkshire"),
15+    ("Tyne and Wear", "Tyne and Wear"),
16+    ("West Midlands", "West Midlands"),
17+    ("West Yorkshire", "West Yorkshire"),
18+    ("Bedfordshire", "Bedfordshire"),
19+    ("Buckinghamshire", "Buckinghamshire"),
20+    ("Cambridgeshire", "Cambridgeshire"),
21+    ("Cheshire", "Cheshire"),
22+    ("Cornwall and Isles of Scilly", "Cornwall and Isles of Scilly"),
23+    ("Cumbria", "Cumbria"),
24+    ("Derbyshire", "Derbyshire"),
25+    ("Devon", "Devon"),
26+    ("Dorset", "Dorset"),
27+    ("Durham", "Durham"),
28+    ("East Sussex", "East Sussex"),
29+    ("Essex", "Essex"),
30+    ("Gloucestershire", "Gloucestershire"),
31+    ("Hampshire", "Hampshire"),
32+    ("Hertfordshire", "Hertfordshire"),
33+    ("Kent", "Kent"),
34+    ("Lancashire", "Lancashire"),
35+    ("Leicestershire", "Leicestershire"),
36+    ("Lincolnshire", "Lincolnshire"),
37+    ("Norfolk", "Norfolk"),
38+    ("Northamptonshire", "Northamptonshire"),
39+    ("Northumberland", "Northumberland"),
40+    ("North Yorkshire", "North Yorkshire"),
41+    ("Nottinghamshire", "Nottinghamshire"),
42+    ("Oxfordshire", "Oxfordshire"),
43+    ("Shropshire", "Shropshire"),
44+    ("Somerset", "Somerset"),
45+    ("Staffordshire", "Staffordshire"),
46+    ("Suffolk", "Suffolk"),
47+    ("Surrey", "Surrey"),
48+    ("Warwickshire", "Warwickshire"),
49+    ("West Sussex", "West Sussex"),
50+    ("Wiltshire", "Wiltshire"),
51+    ("Worcestershire", "Worcestershire"),
52+)
53+
54+"""
55+Source: http://en.wikipedia.org/wiki/List_of_Irish_counties_by_area
56+"""
57+NORTHERN_IRELAND_COUNTY_CHOICES = (
58+    ("County Antrim", "County Antrim"),
59+    ("County Armagh", "County Armagh"),
60+    ("County Down", "County Down"),
61+    ("County Fermanagh", "County Down"),
62+    ("County Londonderry", "County Londonderry"),
63+    ("County Tyrone", "County Tyrone"),
64+)
65+
66+"""
67+Source: http://en.wikipedia.org/wiki/Preserved_counties_of_Wales
68+"""
69+WALES_COUNTY_CHOICES = (
70+    ("Gwent", "Gwent"),
71+    ("South Glamorgan", "South Glamorgan"),
72+    ("Mid Glamorgan", "Mid Glamorgan"),
73+    ("West Glamorgan", "West Glamorgan"),
74+    ("Dyfed", "Dyfed"),
75+    ("Powys", "Powys"),
76+    ("Gwynedd", "Gwynedd"),
77+    ("Clwyd", "Clwyd"),
78+)
79+"""
80+Source: http://www.geo.ed.ac.uk/home/scotland/county3.html
81+"""
82+SCOTTISH_COUNTY_CHOICES = (
83+    ("Aberdeen City", "Aberdeen City"),
84+    ("Aberdeenshire", "Aberdeenshire"),
85+    ("Angus", "Angus"),
86+    ("Argyll and Bute", "Argyll and Bute"),
87+    ("Clackmannan", "Clackmannan"),
88+    ("Dumbarton and Clydebank", "Dumbarton and Clydebank"),
89+    ("Dumfries and Galloway", "Dumfries and Galloway"),
90+    ("Dundee (City of)", "Dundee (City of)"),
91+    ("East Ayrshire", "East Ayrshire"),
92+    ("East Dunbartonshire", "East Dunbartonshire"),
93+    ("East Lothian", "East Lothian"),
94+    ("East Renfrewshire", "East Renfrewshire"),
95+    ("Edinburgh (City of)", "Edinburgh (City of)"),
96+    ("Falkirk", "Falkirk"),
97+    ("Fife", "Fife"),
98+    ("Glasgow (City of)", "Glasgow (City of)"),
99+    ("Highland", "Highland"),
100+    ("Inverclyde", "Inverclyde"),
101+    ("Midlothian", "Midlothian"),
102+    ("Moray", "Moray"),
103+    ("North Ayrshire", "North Ayrshire"),
104+    ("North Lanarkshire", "North Lanarkshire"),
105+    ("Perthshire and Kinross", "Perthshire and Kinross"),
106+    ("Renfrewshire", "Renfrewshire"),
107+    ("Scottish Borders", "Scottish Borders"),
108+    ("South Ayrshire", "South Ayrshire"),
109+    ("South Lanarkshire", "South Lanarkshire"),
110+    ("Stirling", "Stirling"),
111+    ("West Lothian", "West Lothian"),
112+    ("Orkney", "Orkney"),
113+    ("Shetland", "Shetland"),
114+    ("Western Isles", "Western Isles"),
115+)
116+
117+UK_COUNTY_CHOICES = ENGLAND_COUNTY_CHOICES + NORTHERN_IRELAND_COUNTY_CHOICES + WALES_COUNTY_CHOICES + SCOTTISH_COUNTY_CHOICES
118\ No newline at end of file