pax_global_header00006660000000000000000000000064141454160440014515gustar00rootroot0000000000000052 comment=577ca2f4a80713a9272c48db30e914a4d9332358 django-parler-2.3/000077500000000000000000000000001414541604400141065ustar00rootroot00000000000000django-parler-2.3/.coveragerc000066400000000000000000000001311414541604400162220ustar00rootroot00000000000000[run] source = example/article,parler omit = */south_migrations/* */migrations/* django-parler-2.3/.github/000077500000000000000000000000001414541604400154465ustar00rootroot00000000000000django-parler-2.3/.github/workflows/000077500000000000000000000000001414541604400175035ustar00rootroot00000000000000django-parler-2.3/.github/workflows/tests.yaml000066400000000000000000000035261414541604400215370ustar00rootroot00000000000000name: CI Testing on: pull_request: branches: - master push: branches: - master jobs: test: name: "Python ${{ matrix.python }} Django ${{ matrix.django }}" runs-on: ubuntu-latest strategy: # max-parallel: 8 # default is max available fail-fast: false matrix: include: # Django 2.2 - django: "2.2" python: "3.6" - django: "2.2" python: "3.7" - django: "2.2" python: "3.8" - django: "2.2" python: "3.9" # Django 3.1 - django: "3.1" python: "3.6" - django: "3.1" python: "3.7" - django: "3.1" python: "3.8" - django: "3.1" python: "3.9" # Django 3.2 - django: "3.2" python: "3.6" - django: "3.2" python: "3.7" - django: "3.2" python: "3.8" - django: "3.2" python: "3.9" - django: "3.2" python: "3.10" # Django 4.0 - django: "4.0b1" python: "3.10" steps: - name: Install gettext run: sudo apt-get install -y gettext - name: Checkout code uses: actions/checkout@v2 - name: Setup Python ${{ matrix.python }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} - name: Install Packages run: | python -m pip install -U pip python -m pip install "Django~=${{ matrix.django }}" codecov -e .[tests] - name: Run Tests run: | echo "Python ${{ matrix.python }} / Django ${{ matrix.django }}" coverage run --rcfile=.coveragerc runtests.py codecov continue-on-error: ${{ contains(matrix.django, '4.0') }} django-parler-2.3/.gitignore000066400000000000000000000002301414541604400160710ustar00rootroot00000000000000*.pyc *.pyo *.mo *.db *.egg-info/ *.egg/ .coverage .project .idea/ .pydevproject .idea/workspace.xml .DS_Store .tox/ build/ dist/ docs/_build/ htmlcov/ django-parler-2.3/AUTHORS000066400000000000000000000022561414541604400151630ustar00rootroot00000000000000Original authors: * Diederik van der Boor (@vdboor) Contributors: * Basil Shubin (@bashu) * Benjamin Bach (@benjaoming) * Christian de la Fuente (@cdelafuen) * Daniel de la Fuente (@cdelafuente) * Denis Kopitsa (@Alarik) * Didier Raboud (@defivelo) * Ezra Buehler (@easybe) * Francesco Facconi (@mdsol) * Frederik Elwert (@frederik-elwert) * Gurchet Rai * Hervé Cauwelier (@bors-ltd) * Iacopo Spalletti (@yakky) * Jacob Rief (@jrief) * Jeroen Op 't Eynde * Joseph Melettukunnel (@jmelett) * Kim Thoenen (@Chive) * Lior Chen (@liorchen) * Mario Rosa * Martijn Hemeryck * Martin Koistinen (@mkoistinen) * Martin Svoboda (@martinsvoboda) * Michael P. Jung (@bikeshedder) * Mykhailo Kolesnyk (@mikek) * NotSqrt (@NotSqrt) * Omer Katz (@thedrow) * Robin Skahjem-Eriksen (@ironhouzi) * Ryan Senkbeil (@rsenk330) * Sammy Maris (@vikingco) * Stéphane Angel (@twidi) * Tadas Dailyda (@skirsdeda) * Tobias Bengfort (@xi) * Venelin Stoykov * Xavier Fernandez (@xavfernandez) * Yaroslav Klyuyev (@imposeren) * Yunshi TAN (@tanyunshi) * Michael Castelle (@mccc) * @cicuz * @gandon * @liorchen * @ytan Inspired by: * django-hvad, copyright (c) Jonas Obrist, Kristian Øllegaard and others (BSD licensed) django-parler-2.3/CHANGES.rst000066400000000000000000000416711414541604400157210ustar00rootroot00000000000000Changelog ========= Changes in 2.3 (2021-11-18) --------------------------- * Added Django 4.0 support. * Added M2M field support. * Added PARLER_CACHE_PREFIX for sites that share the same cache. Changes in 2.2.1 (2021-10-18) ----------------------------- * Added support for Django 3.2. * Added support for python 3.9. * Dropped support for Python 3.5. * Fixed deprecation warning for ``providing_args`` in Django Signals. Changes in 2.2 (2020-09-06) ----------------------------- * Added support for Django 3.1. * Drop support for Python 2.7. * Drop support for Django 1.11, 2.0, 2.1. Changes in 2.1 (2020-08-05) ----------------------------- * Allows to override the `label`, `error_message` and `help_text` in `TranslatableModelForm`-s. * Fixed Django 3.1 compatibility by adopting import path for form utilities. Changes in 2.0.1 (2020-01-02) ----------------------------- * Fixed Django 3.0 compatibility by removing django.utils.six dependency. * Fixed using ``value_from_object()`` instead of ``get_prep_value()`` in model forms initial data. * Fixed using proper ``get_language()`` call when ``PARLER_DEFAULT_ACTIVATE`` is used. * Fixed confusing ``AttributeError`` on ``_parler_meta`` when migrations don't inherit from ``TranslatableModel``. Changes in 2.0 (2019-07-26) --------------------------- * Added Django 2.1 and 2.2 support * Added translation support to data migrations. * Fixed formatting of initial form values for translated fields. * Fixed admin change view redirects to preserve ``?language=..`` in the query string. * Fixed admin loading ``prepopulate.js`` for DEBUG=True. * Fixed admin quoting for ``object_id`` URLs. * Fixed ``UUIDField`` support. * Fixed object creation when setting the ``pk`` field on newly added objects. * Fixed check on ``MISSING`` sentinel when loading cached models. * Fixed ``QuerySet._clone()`` argument signature. * Fixed ``model.delete()`` call to return collector data. * Fixed ``model.refresh_from_db()`` to clear the translations cache too. * Fixed returning full full ``ValidationError`` data from ``validate_unique()``. * Drop Django 1.7, 1.8, 1.9, 1.10 compatibility. Changes in 1.9.2 (2018-02-12) ----------------------------- * Fixed Django 2.0 ``contribute_to_class()`` call signature. * Fixed "Save and add another" button redirect when using different admin sites. * Fixed import location of ``mark_safe()``. Changes in 1.9.1 (2017-12-06) ----------------------------- * Fixed HTML output in Django 2.0 for the the ``language_column`` and ``all_languages_column`` fields in the Django admin. Changes in 1.9 (2017-12-04) --------------------------- * Added Django 2.0 support. * Fixed ``get_or_create()`` call when no defaults are given. Changes in 1.8.1 (2017-11-20) ----------------------------- * Fixed checkes for missing fallback languages (``IsMissing`` sentinel value leaked through caching) * Fixed preserving the language tab in the admin. * Fixed ``get_or_create()`` call. Changes in 1.8 (2017-06-20) ----------------------------- * Dropped Django 1.5, 1.6 and Python 2.6 support. * Fixed Django 1.10 / 1.11 support: * Fix ``.language('xx').get()`` usage. * Fix models construction via ``Model(**kwargs)``. * Fix test warnings due to tests corrupting the app registry. * Fix support for ``ModelFormMixin.fields`` in ``TranslatableUpdateView``. Django allows that attribute as alternative to setting a ``form_class`` manually. Changes in 1.7 (2016-11-29) --------------------------- * Added ``delete_translation()`` API. * Added ``PARLER_DEFAULT_ACTIVATE`` setting, which allows to display translated texts in the default language even through ``translation.activate()`` is not called yet. * Improve language code validation in forms, allows to enter a language variant. * Fixed not creating translations when default values were filled in. * Fixed breadcrumb errors in delete translation view when using django-polymorphic-tree_. Changes in 1.6.5 (2016-07-11) ----------------------------- * Fix ``get_translated_url()`` when Django uses bytestrings for ``QUERY_STRING``. * Raise ``ValidError`` when a ``TranslatableForm`` is initialized with a language code that is not available in ``LANGUAGES``. **Backwards compatibility note:** An ``ValueError`` is now raised when forms are initialized with an invalid languae code. If your project relied on invalid language settings, make sure that ``LANGAUGE_CODE`` and ``LANGUAGES`` are properly configured. Rationale: Since the security fix in v1.6.3 (to call the ``clean()`` method of translated fields), invalid language codes are no longer accepted. The choice was either to passively warn and exclude the language from validation checks, or to raise an error beforehand that the form is used to initialize bad data. It's considered more important to avoid polluted database contents then preserving compatibility, hence this check remains as strict. Changes in 1.6.4 (2016-06-14) ----------------------------- * Fix calling ``clean()`` on fields that are not part of the form. * Fix tab appearance for Django 1.9 and flat theme. * Fix issues with ``__proxy__`` field for template names * Fix attempting to save invalid ``None`` language when Django translations are not yet initialized. **Note:** django-parler models now mandate that a language code is selected; either by calling ``model.set_current_language()``, ``Model.objects.language()`` or activating a gettext environment. The latter always happens in a standard web request, but needs to happen explicitly in management commands. This avoids hard to debug situations where unwanted model changes happen on implicitly selected languages. Changes in 1.6.3 (2016-05-05) ----------------------------- * **Security notice:** Fixed calling ``clean()`` on the translations model. * Fixed error with M2M relations to the translated model. * Fixed ``UnicodeError`` in ``parler_tags`` * Show warning when translations are not initialized (when using management commands). Changes in 1.6.2 (2016-03-08) ----------------------------- * Added ``TranslatableModelMixin`` to handle complex model inheritance issues. * Fixed tuple/list issues with ``fallbacks`` option. * Fixed Python 3 `__str__()`` output for ``TranslatedFieldsModel``. * Fixed output for ``get_language_title()`` when language is not configured. * Fixed preserving GET args in admin change form view. Changes in version 1.6.1 (2016-02-11) ------------------------------------- * Fix queryset ``.dates()`` iteration in newer Django versions. * Fixed Django 1.10 deprecation warnings in the admin. * Avoided absolute URLs in language tabs. Changes in version 1.6 (2015-12-29) ----------------------------------- * Added Django 1.9 support * Added support to generate ``PARLER_LANGUAGES`` from Django CMS' ``CMS_LANGUAGES``. * Improve language variant support, e.g. ``fr-ca`` can fallback to ``fr``, and ``de-ch`` can fallback to ``de``. * Dropped support for Django 1.4 (also released as 1.6b1 on 2015-12-16) Changes in version 1.5.1 (2015-10-01) ------------------------------------- * Fix handling for non-nullable ``ForeignKey`` in forms and admin. * Fix performance of the admin list when ``all_languages_column`` or ``language_column`` is added to ``list_display`` (N-query issue). * Fix support for other packages that replace the BoundField class in ``Form.__get_item__`` (namely django-slug-preview_). * Fix editing languages that exist in the database but are not enabled in project settings. * Fix DeprecationWarning for Django 1.8 in the admin. Changes in version 1.5 (2015-06-30) ----------------------------------- * Added support for multiple fallback languages! * Added ``translatable-field`` CSS class to the ``