Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ Changelog

Breaking data changes:

A data migration is required for users of `nl.forms.NOMunicipalitySelect`. `MUNICIPALITY_CHOICES` was updated to the
A data migration is required for users of `np.forms.NPProvinceSelect` and `np.forms.NPZoneSelect`. The following was
changed:

- `NPProvinceSelect`: province1 and province2 were removed and replaced with koshi and madhesh.
- `NPZoneSelect`: dandaki was corrected to gandaki (fixed typo).

A data migration is required for users of `no.forms.NOMunicipalitySelect`. `MUNICIPALITY_CHOICES` was updated to the
values in the 2024 update:

- austagder and vestagder have been removed and combined into agder.
Expand Down Expand Up @@ -65,6 +71,13 @@ Modifications to existing flavors:
- hedmark and oppland have been removed and combined into innlandet.

(`gh-509 <https://github.com/django/django-localflavor/pull/509/files>`_).
- Corrections in Nepal localflavor:

- `NPProvinceSelect`: province1 and province2 were removed and replaced with koshi and madhesh.
- `NPZoneSelect`: dandaki was corrected to gandaki (fixed typo).

(`gh-506 <https://github.com/django/django-localflavor/pull/506/files>`_).


Other changes:

Expand Down
3 changes: 3 additions & 0 deletions localflavor/np/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from django.forms.fields import RegexField, Select
from django.utils.translation import gettext_lazy as _
import warnings

from .np_districts import DISTRICTS
from .np_provinces import PROVINCES
Expand Down Expand Up @@ -31,6 +32,7 @@ class NPZoneSelect(Select):
"""

def __init__(self, attrs=None):
warnings.warn("Choices have changed for NPZoneSelect in localflavor 5.0. See changelog for details.")
super().__init__(attrs, choices=ZONES)


Expand All @@ -41,6 +43,7 @@ class NPProvinceSelect(Select):
"""

def __init__(self, attrs=None):
warnings.warn("Choices have changed for NPProvinceSelect in localflavor 5.0. See changelog for details.")
super().__init__(attrs, choices=PROVINCES)


Expand Down
4 changes: 2 additions & 2 deletions localflavor/np/np_provinces.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
('gandaki', _('Gandaki')),
('karnali', _('Karnali')),
('lumbini', _('Lumbini')),
('province1', _('Province 1')),
('province2', _('Province 2')),
('koshi', _('Koshi')),
('madhesh', _('Madhesh')),
('sudurpaschim', _('Sudurpaschim')),
]
2 changes: 1 addition & 1 deletion localflavor/np/np_zones.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
('bagmati', _('Bagmati')),
('bheri', _('Bheri')),
('dhawalagiri', _('Dhawalagiri')),
('dandaki', _('Gandaki')),
('gandaki', _('Gandaki')),
('janakpur', _('Janakpur')),
('karnali', _('Karnali')),
('koshi', _('Koshi')),
Expand Down
6 changes: 3 additions & 3 deletions tests/test_np/selectfields_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
<option value="gandaki">Gandaki</option>
<option value="karnali">Karnali</option>
<option value="lumbini">Lumbini</option>
<option value="province1">Province 1</option>
<option value="province2">Province 2</option>
<option value="koshi">Koshi</option>
<option value="madhesh">Madhesh</option>
<option value="sudurpaschim">Sudurpaschim</option>
</select>
"""
Expand All @@ -95,7 +95,7 @@
<option value="bagmati">Bagmati</option>
<option value="bheri">Bheri</option>
<option value="dhawalagiri">Dhawalagiri</option>
<option value="dandaki">Gandaki</option>
<option value="gandaki">Gandaki</option>
<option value="janakpur">Janakpur</option>
<option value="karnali">Karnali</option>
<option value="koshi">Koshi</option>
Expand Down