Skip to main content

Model translations in a jsonb field

Project description

django-modeltrans

Travis CI Documentation Status Any color you like

Translates Django model fields in a JSONField using a registration approach.

Features/requirements

  • Uses one PostgreSQL jsonb-field per model. (django.contrib.postgres.JSONField for Django<3.1, django.db.models.JSONField for Django>=3.1)
  • Django 2.2, 3.0, 3.1, 3.2, 4.0 (with their supported python versions)
  • PostgreSQL >= 9.5 and Psycopg2 >= 2.5.4.
  • Available on pypi
  • Documentation

Running the tests

tox

Running the tests only for the current environment, use make test

Attribution

Some concepts and code come from https://github.com/deschler/django-modeltranslation, which is in turn inspired by https://github.com/zmathew/django-linguo

We started this solution at Zostera because we did not like:

  • The way django-modeltranslation adds one field per language (and thus requires a migration when adding a language);
  • The unpredictability of the original field.

Since JSONB is supported by Postgres now, we developed this approach.

Relevant 3rd party documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-modeltrans-0.7.5.tar.gz (31.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page