I started looking at this because on the mailing list, having the UK as only shipping country led to confusion. This is mostly due to the shipping address form hiding the country field if there's only one country enabled, but all the validation then requiring UK postcodes and phone numbers. It's bothered me for a while that we're using a fixture to populate the countries, which is at risk of becoming stale. pycountry offers an excellent data source for a list of countries, so I polished an existing management command to use it to populate the country database. This commit has two immediate effects: * New setups will use a more current country database * By default, all countries will be marked as shipping countries pycountry also ships with localised names of the countries, which should allow us to populate the database with localised country names.master
|
||
18 | 18 |
|
19 | 19 |
|
20 | 20 |
|
21 |
|
|
21 |
|
|
22 |
|
|
22 | 23 |
|
23 | 24 |
|
24 | 25 |
|
|
||
36 | 37 |
|
37 | 38 |
|
38 | 39 |
|
39 |
|
|
40 |
|
|
41 |
|
|
40 | 42 |
|
41 | 43 |
|
42 | 44 |
|
|
||
56 | 58 |
|
57 | 59 |
|
58 | 60 |
|
61 |
|
|
59 | 62 |
|
60 | 63 |
|
61 | 64 |
|
|
||
251 | 251 |
|
252 | 252 |
|
253 | 253 |
|
254 |
|
|
254 |
|
|
255 | 255 |
|
256 | 256 |
|
257 |
|
|
258 |
|
|
259 |
|
|
257 |
|
|
258 |
|
|
260 | 259 |
|
261 |
|
|
260 |
|
|
262 | 261 |
|
263 |
|
|
264 |
|
|
265 |
|
|
262 |
|
|
263 |
|
|
264 |
|
|
266 | 265 |
|
267 |
|
|
268 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 | 269 |
|
270 |
|
|
271 |
|
|
270 |
|
|
272 | 271 |
|
273 | 272 |
|
274 | 273 |
|
|
||
200 | 200 |
|
201 | 201 |
|
202 | 202 |
|
203 |
|
|
204 |
|
|
205 |
|
|
206 |
|
|
203 | 207 |
|
204 | 208 |
|
205 | 209 |
|
|
||
387 | 387 |
|
388 | 388 |
|
389 | 389 |
|
390 |
|
|
391 |
|
|
390 |
|
|
392 | 391 |
|
393 | 392 |
|
394 | 393 |
|
|
||
405 | 404 |
|
406 | 405 |
|
407 | 406 |
|
408 |
|
|
407 |
|
|
409 | 408 |
|
410 | 409 |
|
411 | 410 |
|
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
||
34 | 34 |
|
35 | 35 |
|
36 | 36 |
|
37 |
|
|
38 |
|
|
39 |
|
|
||
5 | 5 |
|
6 | 6 |
|
7 | 7 |
|
8 |
|
|
9 | 8 |
|
10 | 9 |
|
11 | 10 |
|
12 | 11 |
|
13 | 12 |
|
14 |
|
|
13 |
|
|
15 | 14 |
|
16 | 15 |
|
17 | 16 |
|
18 | 17 |
|
19 | 18 |
|
20 | 19 |
|
21 |
|
|
22 | 20 |
|
23 | 21 |
|
24 |
|
|
22 |
|
|
25 | 23 |
|
26 | 24 |
|
27 | 25 |
|