Releases: KristianOellegaard/django-hvad
Version 1.2.0
This is a feature release, to push REST framework support onto the main package.
Python and Django versions supported:
- Due to this version being released early, end of support for Django 1.5 has been postponed until next release.
New features:
- Support for Django REST framework is now included. It requires REST framework version 3.1 or newer — #220.
Version 1.1.1
Version 1.1.0
Python and Django versions supported:
- hvad now supports Django 1.8.
- Django 1.5 has reached its end of life, and support will be dropped in hvad 1.2.
Note however that Django 1.4 will still be supported.
New features:
- It is now possible to use translated fields in the
unique_togetherandindex_togethersettings on models. They cannot be mixed in a single constraint though, as table-spanning indexes are not supported by SQL databases. - The
annotatemethod is now supported. Support is still basic for now: annotations may not access more than one level of relation.
Compatibility warnings:
- Internal module
hvad.fieldtranslatorwas no longer used, and was incompatible with Django 1.8. It has been removed. - Deprecated method
using_translations()has been removed. It can be safely replaced bylanguage(). - Deprecated
TranslationFallbackManagerclass has been removed. Please use manager'suntranslated()method instead. - Deprecated
TranslatableModelBasemetaclass has been removed. Since release 0.5, hvad does not trigger metaclass conflicts anymore – #188. - Overriding the language in
QuerySet.get()andQuerySet.filter()was deprecated in release 0.5, and has now been removed. Either use thelanguage()method to set the correct language, or specifylanguage('all')to filter manually throughgetandfilter– #182. TranslatableModel's Internal attribute_shared_field_nameshas been removed.
Deprecation list:
- Passing
unique_togetherorindex_togetheras ametaoption onTranslatedFieldsis now deprecated and will be unsupported in release 1.3. Put them in the model'sMetainstead, alongside normal fields. - Calling
save()on an invalidTranslatableModelFormis a bad practice and breaks on regular Django forms. This is now deprecated, and relevant checks will be removed in release 1.3. Please check the form is valid before saving it. - Generic views in
hvad.viewshave been refactored to follow Django generic view behaviors. As a result, several non-standard methods are now deprecated. Please replace them with their Django equivalents — check #225.
Version 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:
TranslatableModelFormhas 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_factoryintroduced by Django 1.6 and 1.7 are now available ontranslatable_modelform_factoryas well — #221. TranslationQuerysetnow has afallbacks()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
selectitems in methodextra()is now supported. — #207. - It is now possible to use
TranslationQuerysetas 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:
TranslatableModelFormhas 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 returnNoneas per the new semantics introduced in Django 1.7. — #217.- Using
Q objectlogical combinations orexclude()on a translation-aware manager returned byget_translation_aware_managerno longer yields wrong results. - Method
get_or_createnow properly deals with Django 1.6-style transactions.
Version 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:
Version 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:
Version 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 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()andearliest()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 passedNoneas one of the fallbacks, and it will be replaced with current language at query evaluation time. - All queryset classes used by
TranslationManagercan now be customized through the newfallback_classanddefault_classattributes. - The
Meta.orderingmodel setting is now supported on translatable models. It accepts both translated and shared fields, with some restrictions (#185, #12).
Deprecation list:
- The deprecated
nanimodule was removed. - Method
using_translations()is now deprecated. It can be safely replaced bylanguage(). - Overriding the language in
get()andfilter()is deprecated. Either uselanguage()to set the correct language, or specifylanguage('all')to filter manually throughgetandfilter(#182). - The
TranslationFallbackManageris deprecated and will be removed in next release. Please use manager'suntranslated()method instead. - Setting
NANI_TABLE_NAME_SEPARATORwas renamed toHVAD_TABLE_NAME_SEPARATOR.
Using the old name will still work for now, but get removed in next version. - CSS class
nani-language-tabsin admin templates was renamed tohvad-language-tabs. Entities will bear both classes until next version. - Private
_real_managerand_fallback_managerattributes ofTranslationQuerysethave been removed as the indirection served no real purpose. - The
TranslatableModelBasemetaclass is no longer necessary and will be removed in next release. hvad no longer triggers metaclass conflicts andTranslatableModelBasecan be safely dropped (#188).
Fixes:
- Method
latest()now works when passed no field name, properly getting the field name from the model'sget_latest_byoption. FallbackQuerysetnow 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 addingHVAD_LEGACY_FALLBACKS = Trueto your settings.- Assigning value to translatable foreign keys through its
*_idfield no longer results in assigned value being ignored (#193). - Tests were refactored to fully support PostgreSQL – (#194)
Version 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 withprefetch_related(). This dramatically cuts down the number of queries thatTranslatableAdmin.all_translations()generate (bug #97).
Version 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 itsqueryset_classattribute.- 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 aTranslatableModelForm. - Accessing a translated field on an untranslated instance will now raise an
AttributeErrorwith a helpful message instead of letting the error bubble up from the ORM. - Method
in_bulkis now available onTranslationManager.
Removal of the old nani aliases was postponed until next release.
Deprecation list:
- Catching
ObjectDoesNotExistwhen accessing a translated field on an instance is deprecated. In case no translation is loaded and none exists in database for current language, anAttributeErroris raised instead. For the transition, both are supported until next release.
Fixes:
- Fixed an issue where
TranslatableModelAdmincould overwrite the wrong language while saving a form. - No more deprecation warnings when importing only from
hvad. TranslatableAdminnow 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
objectsanymore. Qobjects now work properly withTranslationQueryset.lazy_translation_getternow tries translations insettings.LANGUAGESorder once it has failed with current language and site's mainLANGUAGE_CODE.
0.2
The package is now called ‘hvad’. Old imports should result in an import error.
Fixed django 1.4 support
Fixed a number of minor issues