django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
833 stars 292 forks source link

Update no_municipalities.py to reflect recent changes to norwegian counties #509

Open hakosl opened 5 months ago

hakosl commented 5 months ago

Update list of Norwegian counties(fylker) according to changes at the start of 2024: https://en.wikipedia.org/wiki/Counties_of_Norway#List_of_counties

hakosl commented 5 months ago

I fixed the tests

benkonrath commented 5 months ago

As a follow up to Claude's comment about the changelog, maybe we should use the same procedure as we did with the 3.1 release when we had breaking data changes.

  1. Add a warning to NOMunicipalitySelect.
import warnings

class NOMunicipalitySelect(Select):
    def __init__(self, attrs=None):
        warnings.warn("Choices have changed for NOMunicipalitySelect in localflavor 4.1. See changelog for details.")
        super().__init__(attrs, choices=MUNICIPALITY_CHOICES)
  1. Be very clear about the breaking change at the start of the changelog and provide instructions. The 3.1 release notes are a good example:

https://github.com/django/django-localflavor/blob/master/docs/changelog.rst#31---2021-05-28

@hakosl What do you think?