Django-hvad

Latest version: v1.8.0

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

Scan your dependencies

Page 3 of 4

1.0.0

**Python and Django versions supported:**
- Django 1.3 is no longer supported.
- Python 2.6 is no longer supported. Though it is likely to work for the time being, it has been dropped from the tested setups.

**New features:**
- `TranslatableModelForm` has been refactored to make its behavior more consistent. As a result, it exposes two distinct language selection modes, _normal_ and _enforce_, and has a clear API for manually overriding the language — 221.
- The new features of `modelform_factory` introduced by Django 1.6 and 1.7 are now available on `translatable_modelform_factory` as well — 221.
- `TranslationQueryset` now has a `fallbacks()` method when running on Django 1.6 or newer, allowing the queryset to use fallback languages while retaining all its normal functionalities – 184.
- Passing additional `select` items in method `extra()` is now supported. — 207.
- It is now possible to use `TranslationQueryset` as default queryset for translatable models. — 207.
- A lot of tests have been added, hvad now has 100% coverage on its core modules. Miscellaneous glitches found in this process were fixed.
- Added MySQL to tested database backends on Python 2.7.

**Compatibility warnings:**
- `TranslatableModelForm` has been refactored to make its behavior more consistent. The core API has not changed, but edge cases are now clearly specified and some inconsistencies have disappeared, which could create issues, especially:
- Direct use of the form class, without passing through the factory method. This used to have an unspecified behavior regarding language selection. Behavior is now well-defined. Please ensure it works the way you expect it to.

**Fixes:**
- `TranslatableModelForm.clean()` can now return `None` as per the new semantics introduced in Django 1.7. — 217.
- Using `Q object` logical combinations or `exclude()` on a translation-aware manager returned by `get_translation_aware_manager` no longer yields wrong results.
- Method `get_or_create` now properly deals with Django 1.6-style transactions.

0.5.2

This minor release fixes an unsupported method that came to being used by default Django admin in latest Django update.
**Python and Django versions supported (reminder):**
- Version 0.5.x will be the last to support Django 1.3.
- Version 0.5.x will be the last to support Python 2.6. Though it may
still work for the time being, it will be removed from the tested setups.

**Fixes:**
- Admin does not break anymore on M2M fields on latest Django versions. — 212.
- Related fields's `clear()` method now works properly (it used to break on MySQL, and was inefficient on other engines) — 212.

0.5.1

This minor release backports the fixes from the development branch.

**Python and Django versions supported (reminder):**
- Version 0.5.x will be the last to support Django 1.3.
- Version 0.5.x will be the last to support Python 2.6. Though it may
still work for the time being, it will be removed from the tested setups.

**Fixes:**
- Ecountering a regular (un-translatable) model in a deep `select_related` does
not break anymore. — 206.
- Language tabs URI are now correctly generated when changelist filters are used.
— 203.
- Admin language tab selection is no longer lost when change filters are active.
— 202.

0.5.0

**Python and Django versions supported:**
- This version will be the last to support Django 1.3.
- This version will be the last to support Python 2.6. Though it may still work for the time being, it will be removed from the tested setups.

**New features:**
- Abstract models are now supported (180).
- New [TranslationFormset](http://django-hvad.readthedocs.org/en/latest/public/forms.htmltranslationformset) allows building a formset to work on an instance's translations (157).
- Method `language()` now accepts the special value `'all'`, allowing the query to consider all translations (181).
- Django 1.6+'s new methods `datetimes()` and `earliest()` are now available (175).
- The `select_related()` method is no longer limited to 1-level depth, and is now consistent with the semantics of regular Django querysets (192).
- Django-hvad messages are now available in Italian (178).
- Calls to `language(None)` to use the current language now defer language resolution until the query is
evaluated. It can therefore be used in form definitions directly, for instance for passing a custom queryset to a ModelChoiceField (171).
- Similarly, `use_fallbacks()` can now be passed `None` as one of the fallbacks, and it will be replaced with current language at query evaluation time.
- All queryset classes used by `TranslationManager` can now be customized through the new `fallback_class` and `default_class` attributes.
- The `Meta.ordering` model setting is now supported on translatable models. It accepts both translated and shared fields, with some restrictions (185, 12).

**Deprecation list:**
- The deprecated `nani` module was removed.
- Method `using_translations()` is now deprecated. It can be safely replaced by `language()`.
- Overriding the language in `get()` and `filter()` is deprecated. Either use `language()` to set the correct language, or specify `language('all')` to filter manually through `get` and `filter` (182).
- The `TranslationFallbackManager` is deprecated and will be removed in next release. Please use manager's `untranslated()` method instead.
- Setting `NANI_TABLE_NAME_SEPARATOR` was renamed to `HVAD_TABLE_NAME_SEPARATOR`.
Using the old name will still work for now, but get removed in next version.
- CSS class `nani-language-tabs` in admin templates was renamed to `hvad-language-tabs`. Entities will bear both classes until next version.
- Private `_real_manager` and `_fallback_manager` attributes of `TranslationQueryset` have been removed as the indirection served no real purpose.
- The `TranslatableModelBase` metaclass is no longer necessary and will be removed in next release. hvad no longer triggers metaclass conflicts and `TranslatableModelBase` can be safely dropped (188).

**Fixes:**
- Method `latest()` now works when passed no field name, properly getting the field name from the model's `get_latest_by` option.
- `FallbackQueryset` now leverages the better control on queries allowed in Django 1.6 and newer to use only one query to resolve fallbacks. Old behavior can be forced by adding `HVAD_LEGACY_FALLBACKS = True` to your settings.
- Assigning value to translatable foreign keys through its `*_id` field no longer results in assigned value being ignored (193).
- Tests were refactored to fully support PostgreSQL – (194)

0.4.1

**Fixes:**
- Translations no longer remain in database when deleted depending on the query that deleted them (bug 183).
- `get_available_languages()` now uses translations cache if they were prefetched with `prefetch_related()`. This dramatically cuts down the number of queries that `TranslatableAdmin.all_translations()` generate (bug 97).

0.4.0

**New Python and Django versions supported:**
- django-hvad now supports Django 1.7 running on Python 2.7, 3.3 and 3.4.
- django-hvad now supports Django 1.6 running on Python 2.7 and 3.3.

**New features:**
- `TranslationManager`'s queryset class can now be overriden by setting its `queryset_class` attribute.
- Proxy models can be used with django-hvad. This is a new feature, please use with caution and report any issue on github.
- `TranslatableAdmin`'s list display now has direct links to each available translation.
- Instance's translated fields are now available to the model's `save()` method when saving a `TranslatableModelForm`.
- Accessing a translated field on an untranslated instance will now raise an `AttributeError` with a helpful message instead of letting the error bubble up from the ORM.
- Method `in_bulk` is now available on `TranslationManager`.

Removal of the old `nani` aliases was postponed until next release.

**Deprecation list:**
- Catching `ObjectDoesNotExist` when accessing a translated field on an instance is deprecated. In case no translation is loaded and none exists in database for current language, an `AttributeError` is raised instead. For the transition, both are supported until next release.

**Fixes:**
- Fixed an issue where `TranslatableModelAdmin` could overwrite the wrong language while saving a form.
- No more deprecation warnings when importing only from `hvad`.
- `TranslatableAdmin` now generates relative URLs instead of absolute ones, enabling it to work behind reverse proxies.
- django-hvad does not depend on the default manager being named `objects` anymore.
- `Q` objects now work properly with `TranslationQueryset`.
- `lazy_translation_getter` now tries translations in `settings.LANGUAGES` order once it has failed with current language and site's main `LANGUAGE_CODE`.

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.