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"]
toFalse
. This will prevent hvad from initiating database queries. Accessing translatable attributes with no translation loaded will then raise anAttributeError
. - It is possible to automatically install
TranslationQueryset
as the default queryset for all translatable models, by settingHVAD["USE_DEFAULT_QUERYSET"]
toTrue
. Specifically, it changesTranslationManager.default_class
to be aTranslationQueryset
instead of Django'sQuerySet
.
See the section about overriding the 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 withuse_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 DjangoQuerySet
.
- Code using
- 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.