Django-translated-fields

Latest version: v0.12.0

Safety actively analyzes 623395 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.12

~~~~~~~~~~~~~~~~~~~~

.. _0.12: https://github.com/matthiask/django-translated-fields/compare/0.11...0.12

- **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
underlying ``verbose_name``.
- Stopped overwriting language-specific ``verbose_name`` values.
- Made ``translated_attributes`` fall back to the first entry in
``settings.LANGUAGES`` when no language is active. This previously just
crashed with an ``AttributeError`` (but not caused by non-existant attributes
on the model instance, but caused by the fact that the getter didn't receive
a ``TranslatedField`` instance)
- Added Python 3.10, Django 4.0 to the CI.
- Dropped Python < 3.8, Django < 3.2.
- Added pre-commit.

0.11

~~~~~~~~~~~~~~~~~~~~

.. _0.11: https://github.com/matthiask/django-translated-fields/compare/0.10...0.11

- 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`` and
``TranslatedFieldWithFallback`` 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`` and ``setup.cfg``).
- Fixed a bug where field ordering was incorrect when overriding the
``languages`` list of a translated field with a list longer than
``settings.LANGUAGES``.

0.10

~~~~~~~~~~~~~~~~~~~~

- Changed the ``verbose_name`` of fields generated by
``TranslatedField`` to return the language_code when inside a
``with translated_fields.show_language_code(True):`` block. This
change introduces a dependency on `contextvars
<https://docs.python.org/3/library/contextvars.html>`__ which is
automatically installed from `PyPI
<https://pypi.org/project/contextvars/>`__ in Python<3.7.
- Completely overhauled ``TranslatedFieldAdmin`` to take advantage of
``show_language_code``, making it possible to use translated fields
together with ``list_display_links``, ``list_editable``,
``readonly_fields`` etc.
- Dropped compatibility guarantees for Python 3.5.
- Stopped shadowing import errors.

0.9

~~~~~~~~~~~~~~~~~~~

- Changed ``fallback_to_any`` to also accept the ``field`` 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`` from ``django.core.exceptions``.

0.8

~~~~~~~~~~~~~~~~~~~

- Added an optional ``field`` argument to the ``attrgetter`` and
``attrsetter`` 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
in ``settings.LANGUAGES`` resp. the first entry in the ``languages`` 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 extension ``TranslatedFieldWithFallback`` no
longer fall back to the first entry in ``settings.LANGUAGES`` but to the
fields' first language (which is the same except when overriding the
``languages`` list in the ``TranslatedField`` 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

~~~~~~~~~~~~~~~~~~~

- 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 the
``TranslatedFieldAdmin`` class and made its application automatic as
long as you're not overriding ``get_list_display``.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.