Somehow "XK" is a valid country code [0]. However ist is not listed as current officially assigned ISO 3166-1 alpha-2 codes. Actually it is a so called user-assigned code element. Arnold [0] see e.g. https://www.peeringdb.com/apidocs/#!/ix/Internet_Exchange_list -- Arnold Nipper Chief Technology Evangelist and Co-Founder DE-CIX Management GmbH | Lindleystrasse 12 | 60314 Frankfurt am Main | Germany | www.de-cix.net | Phone +49 69 1730902 22 | Mobile +49 172 2650958 | Fax +49 69 4056 2716 | arnold.nipper@de-cix.net | Geschaeftsfuehrer Harald A. Summa | Registergericht AG Koeln HRB 51135
Any X[A-Z] code is simply a privately used county code. Kosovo has been XK for a while in the RIPE DB.
On May 5, 2016, at 12:39 PM, Arnold Nipper <arnold.nipper@de-cix.net> wrote:
Somehow "XK" is a valid country code [0]. However ist is not listed as current officially assigned ISO 3166-1 alpha-2 codes. Actually it is a so called user-assigned code element.
Arnold
[0] see e.g. https://www.peeringdb.com/apidocs/#!/ix/Internet_Exchange_list -- Arnold Nipper Chief Technology Evangelist and Co-Founder
DE-CIX Management GmbH | Lindleystrasse 12 | 60314 Frankfurt am Main | Germany | www.de-cix.net | Phone +49 69 1730902 22 | Mobile +49 172 2650958 | Fax +49 69 4056 2716 | arnold.nipper@de-cix.net | Geschaeftsfuehrer Harald A. Summa | Registergericht AG Koeln HRB 51135
_______________________________________________ Pdb-tech mailing list Pdb-tech@lists.peeringdb.com http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
Hi Martin, True enough, but I came across this issue when I was trying to use the django-peeringdb code, it relies on django_countries, which is using ONLY ISO approved country-codes. I did a quick hack an added XK to it (+ XK mapping to UNK, numeric 900) UNK = under supervision of united nations, 900-999: numeric range reserved for user defined situations. So our only option to make django_peeringdb work out of the box if we want to keep non-ISO country codes is to create a new CountryField from the one supplied by django_countries, which has a filter accepting these private ranges. The API docs do show 'XK' as a choice. Eric Loos -----Original Message----- From: Pdb-tech [mailto:pdb-tech-bounces@lists.peeringdb.com] On Behalf Of Martin J. Levy Sent: Thursday 5 May 2016 21:48 To: pdb-tech@lists.peeringdb.com Subject: Re: [PDB-tech] Country Code "XK" Any X[A-Z] code is simply a privately used county code. Kosovo has been XK for a while in the RIPE DB.
On May 5, 2016, at 12:39 PM, Arnold Nipper <arnold.nipper@de-cix.net> wrote:
Somehow "XK" is a valid country code [0]. However ist is not listed as current officially assigned ISO 3166-1 alpha-2 codes. Actually it is a so called user-assigned code element.
Arnold
[0] see e.g. https://www.peeringdb.com/apidocs/#!/ix/Internet_Exchange_list -- Arnold Nipper Chief Technology Evangelist and Co-Founder
DE-CIX Management GmbH | Lindleystrasse 12 | 60314 Frankfurt am Main | Germany | www.de-cix.net | Phone +49 69 1730902 22 | Mobile +49 172 2650958 | Fax +49 69 4056 2716 | arnold.nipper@de-cix.net | Geschaeftsfuehrer Harald A. Summa | Registergericht AG Koeln HRB 51135
_______________________________________________ Pdb-tech mailing list Pdb-tech@lists.peeringdb.com http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
Pdb-tech mailing list Pdb-tech@lists.peeringdb.com http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech ________________________________ **** DISCLAIMER**** http://www.bics.com/maildisclaimer/
* "LOOS Eric (BCS/CBU)" <eric.loos@bics.com> [160506 04:59 +0000]:
True enough, but I came across this issue when I was trying to use the django-peeringdb code, it relies on django_countries, which is using ONLY ISO approved country-codes. I did a quick hack an added XK to it (+ XK mapping to UNK, numeric 900) UNK = under supervision of united nations, 900-999: numeric range reserved for user defined situations. From how I read it, using XK in this case is one of the reasons ISO-3166 has user defined codes, specifying a new country before ISO officially adds it. According to wikipedia, it's used by "European Commission, Switzerland, the Deutsche Bundesbank and other organisations."
So our only option to make django_peeringdb work out of the box if we want to keep non-ISO country codes is to create a new CountryField from the one supplied by django_countries, which has a filter accepting these private ranges. The API docs do show 'XK' as a choice. An easier way to deal with it is to add the following to your settings:
# add user defined iso code for Kosovo COUNTRIES_OVERRIDE={ 'XK': _('Kosovo'), }, If you're not using _ for tranlastions, add: _ = lambda s: s or remove _() From https://github.com/peeringdb/peeringdb-py/blob/master/peeringdb/localdb.py#L... We should probably add a note to that for django-peeringdb as well.
Thanks Matt, Had been looking at COUNTIES_OVERRIDE but it complained about the _ indeed, so decided to just add it. If it is that easy, we can get away with updating the documentation. Kind regards, Eric Loos -----Original Message----- From: Matt Griswold [mailto:grizz@20c.com] Sent: Friday 6 May 2016 07:11 To: LOOS Eric (BCS/CBU) Cc: pdb-tech@lists.peeringdb.com Subject: Re: [PDB-tech] Country Code "XK" * "LOOS Eric (BCS/CBU)" <eric.loos@bics.com> [160506 04:59 +0000]:
True enough, but I came across this issue when I was trying to use the django-peeringdb code, it relies on django_countries, which is using ONLY ISO approved country-codes. I did a quick hack an added XK to it (+ XK mapping to UNK, numeric 900) UNK = under supervision of united nations, 900-999: numeric range reserved for user defined situations. From how I read it, using XK in this case is one of the reasons ISO-3166 has user defined codes, specifying a new country before ISO officially adds it. According to wikipedia, it's used by "European Commission, Switzerland, the Deutsche Bundesbank and other organisations."
So our only option to make django_peeringdb work out of the box if we want to keep non-ISO country codes is to create a new CountryField from the one supplied by django_countries, which has a filter accepting these private ranges. The API docs do show 'XK' as a choice. An easier way to deal with it is to add the following to your settings:
# add user defined iso code for Kosovo COUNTRIES_OVERRIDE={ 'XK': _('Kosovo'), }, If you're not using _ for tranlastions, add: _ = lambda s: s or remove _()
From https://github.com/peeringdb/peeringdb-py/blob/master/peeringdb/localdb.py#L...
We should probably add a note to that for django-peeringdb as well. ________________________________ **** DISCLAIMER**** http://www.bics.com/maildisclaimer/
* "LOOS Eric (BCS/CBU)" <eric.loos@bics.com> [160506 05:13 +0000]:
Had been looking at COUNTIES_OVERRIDE but it complained about the _ indeed, so decided to just add it. If it is that easy, we can get away with updating the documentation. Updated documentation, pending further discussion.
This ...
# add user defined iso code for Kosovo COUNTRIES_OVERRIDE={ 'XK': _('Kosovo'), },
... is pretty much how most players handle this. There's also the same issue with "EU" & "AP" (Asia Pacific - used by APNIC) and those sometimes need to be added to COUNTRIES_OVERRIDE. There's still "SU" and "YU" to be found in the wild; however PDB doesn't need to address this. Plus ... there's a slight issue with "UK" and "GB"; but I think that's been flushed out of the PDB database (via Andy D, Will H, Kai, Grizz and myself). It's needed when mapping from RIPE ASNs into TLDs. For example http://bgp.he.net/country/GB maps into UK. Damn Brits! Martin
On May 5, 2016, at 10:32 PM, Matt Griswold <grizz@20c.com> wrote:
* "LOOS Eric (BCS/CBU)" <eric.loos@bics.com> [160506 05:13 +0000]:
Had been looking at COUNTIES_OVERRIDE but it complained about the _ indeed, so decided to just add it. If it is that easy, we can get away with updating the documentation. Updated documentation, pending further discussion.
Pdb-tech mailing list Pdb-tech@lists.peeringdb.com http://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech
participants (4)
-
Arnold Nipper -
LOOS Eric (BCS/CBU) -
Martin J. Levy -
Matt Griswold