0.13 (2024-06-20)
- Added Django 4.1, 4.2 and 5.0 to the CI matrix.
- Added Python 3.11 and 3.12 to the CI matrix.
- Removed the never officially documented way to specify the
formfield_callback
for modelforms, see https://code.djangoproject.com/ticket/26456. - Switched to hatchling and ruff.
- Updated our pre-commit hooks.
- Fixed the Read the Docs configuration.
0.12 (2022-04-08)
- BACKWARDS INCOMPATIBLE: Made the
field
keyword argument to the attrgetter and attrsetter functions mandatory. django-translated-fields raised a deprecation warning if an attrgetter or attrsetter didn't support it since 0.8 (released in 2019) so this shouldn't be a problem for anyone, hopefully. - Made
language_code_formfield_callback
preserve the lazyness of the underlyingverbose_name
. - Stopped overwriting language-specific
verbose_name
values. - Made
translated_attributes
fall back to the first entry insettings.LANGUAGES
when no language is active. This previously just crashed with anAttributeError
(but not caused by non-existant attributes on the model instance, but caused by the fact that the getter didn't receive aTranslatedField
instance) - Added Python 3.10, Django 4.0 to the CI.
- Dropped Python < 3.8, Django < 3.2.
- Added pre-commit.
0.11 (2021-04-12)
- Changed
TranslatedFieldAdmin
to not blindly call.render()
on all responses, just on those actually having such an attribute. - Changed
fallback_to_default
,fallback_to_any
andTranslatedFieldWithFallback
to not fail with an attribute error if no language is active at all. - Renamed the main branch of the repository to
main
. - Switched from Travis CI to GitHub actions.
- Verified compatibility with Python 3.9 and Django 3.2.
- Renamed the main branch to
main
. - Switched to a declarative setup (
setup.py
andsetup.cfg
). - Fixed a bug where field ordering was incorrect when overriding the
languages
list of a translated field with a list longer thansettings.LANGUAGES
.
0.10 (2020-07-27)
- Changed the
verbose_name
of fields generated byTranslatedField
to return the language_code when inside awith translated_fields.show_language_code(True):
block. This change introduces a dependency on contextvars which is automatically installed from PyPI in Python<3.7. - Completely overhauled
TranslatedFieldAdmin
to take advantage ofshow_language_code
, making it possible to use translated fields together withlist_display_links
,list_editable
,readonly_fields
etc. - Dropped compatibility guarantees for Python 3.5.
- Stopped shadowing import errors.
0.9 (2020-05-14)
- Changed
fallback_to_any
to also accept thefield
as an argument, which avoids warnings. - Added Django 3.1 to the matrix, dropped unmaintained Django versions (all versions < 2.2).
- Fixed a compatibility problem with Django 3.1 by importing
FieldDoesNotExist
fromdjango.core.exceptions
.
0.8 (2019-06-26)
- Added an optional
field
argument to theattrgetter
andattrsetter
functions. - Added a utils module intended to contain common applications of
translated fields. For now,
TranslatedFieldWithFallback
creates a field where all languages but the primary language (the first language insettings.LANGUAGES
resp. the first entry in thelanguages
argument if given) are optional and and fall back to the field in the primary language if their value is falsy. - Added a
fallback_to_any
translated attribute getter which returns either the attribute in the current language or in any of the languages. fallback_to_default
and by extensionTranslatedFieldWithFallback
no longer fall back to the first entry insettings.LANGUAGES
but to the fields' first language (which is the same except when overriding thelanguages
list in theTranslatedField
instantiation).- Added a
field
keyword argument to the attrgetter and attrsetter calls. If an existing custom getter or setter does not support the argument you'll get a deprecation warning.
0.7 (2018-10-17)
- Reused Django's own machinery for displaying data in the changelist instead of playing catch-up ourselves.
- Moved the
list_display_column
helper functionality into theTranslatedFieldAdmin
class and made its application automatic as long as you're not overridingget_list_display
.
0.6 (2018-10-17)
- Added an example and an explanation how to best customize the administration interface when using django-translated-fields.
- Added Django 2.1 to the Travis CI test matrix (no changes were necessary for compatibility).
- Made pull requests not following the black coding style fail.
- Added the "production/stable" development status trove identifier.
- Dropped Python 3.4 from the build matrix.
- Added a
list_display_column
helper for showing language codes in column titles.
0.5 (2018-06-14)
- Replaced the
verbose_name_with_language
option and theverbose_name
mangling it does withTranslatedFieldAdmin
which offers the same functionality, but restricted to the admin interface.
0.4 (2018-06-14)
- Switched the preferred quote to
"
and started using black to automatically format Python code. - Added Python 3.4 to the test matrix.
- Made documentation better.
0.3 (2018-05-03)
- Added documentation.
- Converted the
TranslatedField
into a descriptor, and made available a few useful fields on the descriptor instance. - Made it possible to set the value of the current language's field, and
added another keyword argument for replacing the default
attrsetter
. - Made
to_attribute
fall back to the current language. - Added exports for
to_attribute
,translated_attrgetter
andtranslated_attrsetter
totranslated_fields
. - Added an
attrgetter
argument totranslated_attributes
.
0.2 (2018-04-30)
- By default the language is appended to the
verbose_name
of fields created byTranslatedField
. Added theverbose_name_with_language=True
parameter toTranslatedField
which allows skipping this behavior. - Added a
languages
keyword argument toTranslatedField
to allow specifying a different set of language-specific fields than the default of thesettings.LANGUAGES
setting. - Added a
attrgetter
keyword argument toTranslatedField
to replace the default implementation of language-specific attribute getting. - Added the possibility to override field keyword arguments for specific
languages, e.g. to only make a single language field mandatory and
implement your own fallback via
attrgetter
.
0.1 (2018-04-18)
- Initial release!