Django-hvad

Latest version: v1.8.0

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

Scan your dependencies

Page 1 of 4

1.8.0

**Python and Django versions supported:**

- Support for Django 1.10 was added.
- Django 1.7 is no longer supported.
- So, as a reminder, supported Django versions for this release are:
1.8 LTS, 1.9, 1.10.x (for x ≥ 1) and 1.11.

**New features:**

- Automatic loading of translations on attribute access can now be disabled, by setting ``HVAD["AUTOLOAD_TRANSLATIONS"]`` to ``False``. This will prevent hvad from initiating database queries. Accessing translatable attributes with no translation loaded will then raise an `AttributeError`.
- It is possible to automatically install `TranslationQueryset` as the default queryset for all translatable models, by setting `HVAD["USE_DEFAULT_QUERYSET"]` to `True`. Specifically, it changes `TranslationManager.default_class` to be a `TranslationQueryset` instead of Django's `QuerySet`.
See the section about [overriding the default queryset](http://django-hvad.readthedocs.io/en/latest/public/models.htmloverride-default-queryset) for advantages and caveats of doing so.
- Field declaration for internal ``language_code`` attribute can be overriden. — 332.

**Compatibility warnings:**

- All settings have been moved to a unique `HVAD` dictionary. Please update your django settings accordingly.
- Deprecated class `FallbackQueryset` has been removed. Using it along with `use_fallbacks()` did not work on Django 1.9 and newer and was deprecated on older versions. Using it without that method made it behave like a regular queryset. So as a summary,
* Code using `.untranslated().use_fallbacks()` must be replaced with `.language().fallbacks()`.
* All other uses of `FallbackQueryset` can be safely replaced with a regular Django `QuerySet`.
- Translated admin no longer shows objects lacking a translation. This was already the case on Django 1.9 and newer, and this behavior now extends to all Django versions. Such objects should not happen anyway, and throw a warning when encountered.

**Fixes:**

- Increase speed of translated attribute access by ~30%, by avoiding a method call when a translation is loaded.
- Attempting to use a reserved name for a translated field now raises an `ImproperlyConfigured` exception instead of silently ignoring the field.
- Instances created by serializers using REST `TranslatableModelMixin` in normal, non-*enforcing* mode can no longer be created without a translation — 322.

1.7.0

**New features:**
- Support for `defer()` and `only` was added. Note that deferring
all translated fields will **not** result in translation being skipped,
because 1) it needs to be inspected for language resolution and 2) loaded
translation language must be fixed at query time.
Support is limited to immediate fields at the moment, ie it is not possible
to defer fields of additionals models loaded through `select_related()`.

**Compatibility warnings:**
- Internal admin method `TranslatableAdmin.get_available_languages()`
is deprecated and will be removed. Use `TranslatableModel.get_available_languages()` instead.
- Internal admin method `TranslatableAdmin.get_language_tabs()` signature changed.

**Fixes:**
- Do not consider annotations when looking up translatable query fields.
Fixes errors that could arise when using some annotation names.
— 303.
- Accept special value `__all__` for form field list, as a synonym for `None`,
meaning include all known fields. — 313.
- Fix translation deletion links that were improperly generated when using inline
change forms. — 317.

1.6.0

**Python and Django versions supported:**
- Support for Django 1.10 was added. It requires version 1.10.1 or better.
- So, as a reminder, supported Django versions for this release are: 1.7, 1.8 LTS, 1.9, 1.10.x (for x ≥ 1).

**Fixes:**
- No longer set `master` to `NULL` before clearing translations when using `delete_translations`. This only triggers one query instead of two, and allows enforcing non-null foreign key at the database level.
- Django system checks are now run in the test suite in addition to hvad's tests.

1.5.1

**Fixes**
- Filter out m2m and generic fields in `update_translation()` so it does not bite when using (unsupported) m2m fields or generic relations in a translation — 285.
- Add missing unicode markers for python2 — 291.

1.5.0

**Python and Django versions supported:**
- Django 1.4 LTS is no longer supported.
- So, as a reminder, supported Django versions for this release are: 1.7, 1.8 LTS, 1.9.

**New features:**
- It is now possible to specify a custom translation base
model, allowing advanced translation manipulation, such as controlling their loading
with `Model.from_db()`.
- Translated model's `save()` method now accepts translated field
names in `update_fields`. Also, if only translated fields, or only untranslated fields
are specified in `update_fields`, the extra query will be skipped.
- Support for third parameter on `ModelAdmin`'s
`get_object` method was added.
- Experimental support for using `language('all')` together with
`select_related()` is being introduced. Please
check the generated queries if you use it. Feedback is appreciated.

**Compatibility Warnings:**
- Saving of translations now happens in the model's `save()` method.
It used to happen in the `post_save` signal.
- `TranslationsMixin` now splits the update into `update` and `update_translation` methods.
The former is called once per save, and uses the latter as many times as required to update
all translations.

1.4.0

**Python and Django versions supported:**
- Support for Python 3.5 was added.
- Support for Django 1.9 was added.
- Django 1.6 is no longer officially supported.
- Django 1.4 LTS has reached its end of life, and support will be dropped in hvad 1.5.
- So, as a reminder, supported versions for this release are: 1.4 LTS, 1.7, 1.8 LTS, 1.9.

**Compatibility Warnings:**
- As a result of the annotations fix (see below), applications that worked around
`QuerySet.annotate`'s shortcomings on translation
querysets are likely to break, as `annotate()` has been fixed. The
workarounds should be simply removed.
- Method `FallbackQueryset.use_fallbacks()`
is **not** supported on Django 1.9 and newer (and deprecated on other versions, see
below). Please use `TranslationQueryset.fallbacks()` instead.
- Translated admin no longer shows objects lacking a translation, starting from
Django 1.9. This behavior will be extended to all Django versions in the next release.
Such objects should not happen anyway, and throw a warning when encountered.
- Translation model building has been refactored. It is functionally equivalent to its previous
implementation (it passes the exact same test suite), but code depending on the internals
and inner implementation details could break.

**Deprecation List:**
- Method `FallbackQueryset.use_fallbacks()`
is now deprecated on Django 1.6 and newer. The plan is to completely drop
`FallbackQueryset` in the near future, and let
`TranslationManager.untranslated()`
default to returning a plain Django queryset, thus enabling
`MyModel.objects.untranslated()` to give access to all features a plain
Django queryset supports.
For queries that need fallbacks, the `use_fallbacks()` method has long been
superseded by `TranslationQueryset.fallbacks()`, which is
better tested, uses simpler code yet supports more features.
Please update your queries accordingly:
`MyModel.objects.untranslated().use_fallbacks('en', 'ja', 'fr')` should be
rewritten as `MyModel.objects.language('en').fallbacks('ja', 'fr')`, or even
`MyModel.objects.language().fallbacks()` to have the query use your application's
language settings automatically.

**Fixes:**
- Annotations added to a `TranslationQueryset` using the
`QuerySet.annotate` method no longer end up on
the translation cache with a `master__` prefix.
- Specifying translation fields in `unique_together` on translatable models
no longer causes Django to generate incorrect migrations. — 260.
- When no `Meta` options are set on a `TranslatableModelForm`,
the auto-created one now correctly inherits that of its first base class that
has one set — 262.
- Using `language('all')` together with `values()` no longer breaks — 264.

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.