Skip to main content

A content translation framework for django integrated automatically in the normal ORM. Removes the pain of having to think about translations in a django project.

Project description

Model translations made easy.

This project is yet another attempt at making model translations suck less in Django. It uses an automatically created Translations Model to store translatable fields in arbitrary languages with a foreign key to the main model.

Features

  • Simple API - less than 10 new methods.

  • Reliable - more than 200 test cases and counting.

  • Versatile - can manipulate arbitrary languages without changing the DB schema.

  • Complete - supports relationships, proxy models, and - from v0.5 - abstract models.

  • Fast - few and simple queries

  • High level - no custom SQL Compiler or other scary things

  • Batteries included - translation-enabled forms and admin are provided.

  • Compatible with Django 1.3 to 1.7, running Python 2.6+ or 3.3+.

Example

Normal.objects.all()

Returns all objects, but without any translated fields attached - this query is just the default django queryset and can therefore be used as usual.

Normal.objects.language().all()

Returns all objects as translated instances, but only the ones that are translated into the currect language. You can also specify which language to get, using e.g.

Normal.objects.language(“en”).all()

Thanks to

Jonas Obrist (https://github.com/ojii) for making django-nani and for helping me with this project.

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-hvad-0.5.2.tar.gz (84.6 kB view details)

Uploaded Source

File details

Details for the file django-hvad-0.5.2.tar.gz.

File metadata

  • Download URL: django-hvad-0.5.2.tar.gz
  • Upload date:
  • Size: 84.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-hvad-0.5.2.tar.gz
Algorithm Hash digest
SHA256 6f67b62f32bcdc3f637d09cb88e29aa40982527e0633ba6269a52cac192c8524
MD5 0b28a19d00eb7cd61bbc5c5aaa45f800
BLAKE2b-256 7cead50314478907cf21d024ad25fb5569ad08772ba7f18af6a775f942c7164f

See more details on using hashes here.

Provenance

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