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_together
andindex_together
settings on models. They cannot be mixed in a single constraint though, as table-spanning indexes are not supported by SQL databases. - The
annotate
method is now supported. Support is still basic for now: annotations may not access more than one level of relation.
Compatibility warnings:
- Internal module
hvad.fieldtranslator
was 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
TranslationFallbackManager
class has been removed. Please use manager'suntranslated()
method instead. - Deprecated
TranslatableModelBase
metaclass 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 throughget
andfilter
– #182. TranslatableModel
's Internal attribute_shared_field_names
has been removed.
Deprecation list:
- Passing
unique_together
orindex_together
as ameta
option onTranslatedFields
is now deprecated and will be unsupported in release 1.3. Put them in the model'sMeta
instead, alongside normal fields. - Calling
save()
on an invalidTranslatableModelForm
is 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.views
have 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:
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 ontranslatable_modelform_factory
as well — #221. TranslationQueryset
now 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
select
items in methodextra()
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 returnNone
as per the new semantics introduced in Django 1.7. — #217.- Using
Q object
logical combinations orexclude()
on a translation-aware manager returned byget_translation_aware_manager
no longer yields wrong results. - Method
get_or_create
now 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 passedNone
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 newfallback_class
anddefault_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 bylanguage()
. - Overriding the language in
get()
andfilter()
is deprecated. Either uselanguage()
to set the correct language, or specifylanguage('all')
to filter manually throughget
andfilter
(#182). - The
TranslationFallbackManager
is deprecated and will be removed in next release. Please use manager'suntranslated()
method instead. - Setting
NANI_TABLE_NAME_SEPARATOR
was renamed toHVAD_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 tohvad-language-tabs
. Entities will bear both classes until next version. - Private
_real_manager
and_fallback_manager
attributes ofTranslationQueryset
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 andTranslatableModelBase
can be safely dropped (#188).
Fixes:
- Method
latest()
now works when passed no field name, properly getting the field name from the model'sget_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 addingHVAD_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)
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_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 aTranslatableModelForm
. - 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 onTranslationManager
.
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, anAttributeError
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 withTranslationQueryset
.lazy_translation_getter
now tries translations insettings.LANGUAGES
order 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