As discussed, we need to record sub-units of Belgium and UK separately, as they have separate HE systems.
Per our discussion, these should just be "Country" records in addition to the entire countries.
Changes needed to the Country model:
self-referencing foreign key to the parent country (separate flag not needed: if this field is null it's a country, if non-null it's a sub-unit)
extend length of the ISO-3166 alpha-2 code field (let's say up to 10 chars to be future-proof), so we can record ISO 3166-2 codes where they exist (e.g. GB-ENG, GB-SCT) or use some own suffixed codes (e.g. BE-fl, BE-fr)
add field (plain string) for Sub-Country label/name used by OrgReg (see LOCAT.SUBCOUNTRY)
Related changes for the Country model:
add EU 2-letter code as used by OrgReg (basically identical to ISO-3166 alpha-2 except for UK instead of GB), this should prevent the need to hard-code this conversion
The new fields that take URLs should be long enough not to cause issues.
In addition, I think we should declare all 4 new code fields, iso_3166_alpha2 and iso_3166_alpha3 as unique to ensure integrity. If you define them with blank=True and null=True then empty fields should be saved as null value, which means several would be allowed.
The OrgReg sync (#444) should follow this logic to translate a location's country: if Sub-Country (LOCAT.SUBCOUNTRY) field is present in OrgReg, look for a country where Sub-Country name matches and parent's EU 2-letter code (new field) matches - else match on EU 2-letter code.
As discussed, we need to record sub-units of Belgium and UK separately, as they have separate HE systems.
Per our discussion, these should just be "Country" records in addition to the entire countries.
Changes needed to the Country model:
GB-ENG
,GB-SCT
) or use some own suffixed codes (e.g.BE-fl
,BE-fr
)LOCAT.SUBCOUNTRY
)Related changes for the Country model:
UK
instead ofGB
), this should prevent the need to hard-code this conversionThe new fields that take URLs should be long enough not to cause issues.
In addition, I think we should declare all 4 new code fields,
iso_3166_alpha2
andiso_3166_alpha3
as unique to ensure integrity. If you define them withblank=True
andnull=True
then empty fields should be saved as null value, which means several would be allowed.The OrgReg sync (#444) should follow this logic to translate a location's country: if Sub-Country (
LOCAT.SUBCOUNTRY
) field is present in OrgReg, look for a country where Sub-Country name matches and parent's EU 2-letter code (new field) matches - else match on EU 2-letter code.