Skip to content

Releases: KristianOellegaard/django-hvad

Version 1.2.0

19 Mar 16:36
1.2.0
Compare
Choose a tag to compare

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

05 Mar 05:03
1.1.1
Compare
Choose a tag to compare

Fixes:

  • Backwards compatibility issue in get_field implementation — #233.
  • Admin no longer breaks on models using another pk field than id#231.

Version 1.1.0

17 Feb 17:15
1.1.0
Compare
Choose a tag to compare

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 and index_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 by language().
  • Deprecated TranslationFallbackManager class has been removed. Please use manager's untranslated() 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() and QuerySet.filter() was deprecated in release 0.5, and has now been removed. Either use the language() method to set the correct language, or specify language('all') to filter manually through get and filter#182.
  • TranslatableModel's Internal attribute _shared_field_names has been removed.

Deprecation list:

  • Passing unique_together or index_together as a meta option on TranslatedFields is now deprecated and will be unsupported in release 1.3. Put them in the model's Meta instead, alongside normal fields.
  • Calling save() on an invalid TranslatableModelForm 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

19 Dec 12:16
1.0.0
Compare
Choose a tag to compare

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.

Version 0.5.2

08 Nov 18:02
0.5.2
Compare
Choose a tag to compare

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.

Version 0.5.1

23 Oct 22:54
0.5.1
Compare
Choose a tag to compare

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.

Version 0.5.0

11 Sep 09:24
0.5.0
Compare
Choose a tag to compare

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() 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)

Version 0.4.1

01 Jun 11:20
0.4.1
Compare
Choose a tag to compare

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).

Version 0.4.0

18 May 14:29
0.4.0
Compare
Choose a tag to compare

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.

0.2

02 Jul 21:26
Compare
Choose a tag to compare
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