File python-django-countries.changes of Package python-django-countries
-------------------------------------------------------------------
Sat Mar 21 14:33:21 UTC 2026 - Dirk Müller <dmueller@suse.com>
- update to 8.2.0:
* Add `django_countries.django_filters.CountryFilter` for
django-filters integration with support for custom
`empty_label`. This filter automatically sets country choices
and seamlessly integrates with django-filters FilterSets,
making it easier to add country filtering to your views.
* Enable `CountryFieldMixin` to accept `name_only`,
`country_dict`, and output customization options via
`Meta.extra_kwargs`. You can now configure country field
serialization behavior without explicitly declaring
serializer fields, making it easier to customize output for
both single and multiple country fields.
* `CountryField(country_dict=...)` now accepts either a boolean
(existing behaviour) or an iterable/string of keys so you can
control exactly which values appear in the serialized country
dict (for example `("code", "name", "alpha3")` or just
`"alpha3"`).
* Add `COUNTRIES_FIRST_BY_LANGUAGE` and
`COUNTRIES_FIRST_AUTO_DETECT` settings for dynamic country
ordering based on user language. Countries can now be
automatically reordered based on the current language, with
locale-based auto-detection (e.g., `fr-CA` users see Canada
prepended to the French country group).
* Add support for custom `flag_url` in `COUNTRIES_OVERRIDE`
setting. You can now specify a custom flag URL for overridden
countries:
* Fix `CountryField` serializer to respect current language
when deserializing localized country names. The field now
automatically uses Django's `get_language()` to detect the
active language and falls back to English if the country name
is not found in the current language.
* Fixed `CountryFilter` to support filtering on `CountryField`
through relations (e.g., `list_filter = [("contact__country",
CountryFilter)]`). Previously this would fail with a
`FieldError`.
* Fixed `CountryFilter` admin filter to work correctly with
`CountryField(multiple=True)`. The filter now uses the
`__contains` lookup instead of exact matching to properly
find records where the selected country appears in the comma-
separated country list.
* Added support for `empty_label` parameter in
`CountryField.formfield()` to customize the blank choice
label in form fields. This allows using `empty_label=""` for
an empty label or `empty_label="Custom text"` for custom
text, resolving the issue where `empty_label` was previously
ignored.
* Fixed type annotation for `CountryField.countries` parameter
in stub file to accept `type[Countries]` instead of
`Countries` instance, resolving mypy errors when using custom
Countries subclasses. Also removed unnecessary exclusion of
tests from mypy checking.
* Fixed `CountryField(multiple=True)` not marking selected
options in Django forms.
* DRF serializer fields now respect the `allow_null` parameter,
returning `None` for NULL values when `allow_null=True`.
* This enables better API consistency and is particularly
useful with `unique=True` constraints, which allow multiple
NULL values but not multiple empty strings in the database.
* Add support for `null=True` on multiple country fields,
allowing This nullable unique constraints on multiple country
fields.
* `CountryField(multiple=True, null=True)` now returns `None`
for NULL database values instead of crashing and the
historical system check `E100` that blocked `multiple=True` +
`null=True` has been removed.
* Fixed OpenAPI schema generation for `CountryField` when using
`country_dict=True` or `name_only=True`. The field now
correctly generates an object schema (with `code` and `name`
properties) for `country_dict=True` and a string schema for
`name_only=True`, instead of incorrectly generating an enum
schema. This fixes schema generation for both DRF's built-in
OpenAPI support and drf-spectacular, enabling accurate
TypeScript client generation and other API tooling.
* Major performance enhancement for Django admin. Added per-
language caching to `Countries.__iter__()`, delivering 20-40×
speedup when displaying `CountryField` in `list_display`
(admin changelist now renders in <0.5s instead of 6-10s).
* Fixed a regression where a country field allowing for
selection of multiple countries could not be added to using
the + operator.
-------------------------------------------------------------------
Sun Apr 7 09:09:09 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 7.6.1:
* Fix a TypeError when no country is selected, introduced in
the Django 5 fix.
* Replace deprecated pkg_resources.iter_entry_points with
importlib_metadata.
* Support Django 5.0.
-------------------------------------------------------------------
Wed Nov 29 12:05:05 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 7.5.1:
* Make ``CountryField`` queryset filters also work with country
codes in addition to names.
* Switch to ``pyproject.toml`` rather than ``setup.py`` to fix
installation issues with pip 23.0+.
* Rename Turkey to Türkiye.
* Improve translation fallback handling, fixing a threading
race condition that could cause odd translation issues.
* This also fixes translation issues with older Python 3.6/3.7
versions.
* Add Python 3.11, drop Python 3.6 and Django 2.2 support.
* Fix error when using ``USE_I18N = False``.
* Fix broken translations due to last common country names fix.
* Fixed Traditional Chinese translation (needed to be
``locale/zh_Hant``).
* Update flag of Honduras.
* Add Django 4.0 and 4.1 to the test matrix, dropping 3.0 and
3.1
* Add Django Rest Framework 3.13 and 3.14, dropping 3.11.
* Multi-choice countries are now stored sorted and with
duplicates stripped.
* Fix common country names not being honoured in non-English
translations (only fixed for Python 3.8+).
* Fix slowdown introduced in v7.3 caused by always using
country name lookups for field comparisons.
``filter(country="New Zealand")`` will no longer match now,
but instead new ``__name`` and ``__iname`` filters have
been added to achieve this.
* Typing compatibility fixes for Python <3.9.
* Make full English country names work in database lookups, for
example, ``Person.objects.filter(country__icontains="zealand")``.
-------------------------------------------------------------------
Tue May 11 23:20:32 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- Add optional dependency pyuca
- Update to v7.2.1
* Fix Latin translations.
- from v7.2
* Allow the character field to work with custom country codes that
are not 2 characters (such as "GB-WLS").
* Fix compatibility with django-migrations-ignore-attrs library.
- from v7.1
* Allow customising the str_attr of Country objects returned from
a CountryField via a new countries_str_attr keyword argument
* Add pyuca as an extra dependency, so that it can be installed
like pip install django-countries[pyuca].
* Add Django 3.2 support.
- from v7.0
* Add name_only as option to the DRF serializer field
* Add in Python typing.
* Add Python 3.9, Django 3.1, and Django Rest Framework 3.12 support
* Drop Python 3.5 support.
* Improve IOC code functionality, allowing them to be overridden in
COUNTRIES_OVERRIDE using the complex dictionary format.
- from v6.1.3
* Update flag of Mauritania.
* Add flag for Kosovo (under its temporary code of XK)
-------------------------------------------------------------------
Sat Jun 6 06:50:19 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- Update to v6.1.2
-------------------------------------------------------------------
Thu Apr 18 23:15:50 UTC 2019 - John Vandenberg <jayvdb@gmail.com>
- Convert to single spec, fdupes, tidy
- Add Obsoletes/Provides for old Python 2 package name
- Remove tests from runtime package, fix hashbangs
- Use %license, add CHANGES.rst to %doc
- Update to v5.3.3
-------------------------------------------------------------------
Fri Sep 27 16:39:07 UTC 2013 - p.drouand@gmail.com
- Update to version 1.5
+ No changelog available
- Replace python-distribute with python-setuptools BuildRequires
-------------------------------------------------------------------
Mon Oct 15 23:04:14 UTC 2012 - jfunk@funktronics.ca
- Update to 1.4:
* Added and updated translations
* Updated country list (Libya changed)
- Run tests
- Add LICENSE to %doc
- README is now README.rst
-------------------------------------------------------------------
Sat Oct 8 18:25:21 UTC 2011 - alexandre@exatati.com.br
- Update to 1.1.1:
- Sorry, no changelog.
-------------------------------------------------------------------
Thu Oct 6 02:14:48 UTC 2011 - alexandre@exatati.com.br
- Update to 1.1;
- Regenerate spec file with p2pack.
-------------------------------------------------------------------
Fri Jan 23 00:10:48 CET 2009 - poeml@suse.de
- initial package (0.1-r3)