Python Shell
Pull request Compare This branch is 297 commits behind KristianOellegaard:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs nani->hvad in docs Jul 18, 2012
hvad
nani Merged hvad-nani refactor with master May 4, 2012
testproject Merged hvad-nani refactor with master May 4, 2012
.gitignore New gitignore Oct 17, 2011
.travis.yml django-cbv is required with django 1.2.x if you want to use the class… Mar 29, 2012
AUTHORS Added Daniele to AUTHORS Apr 6, 2012
LICENSE
MANIFEST.in finaly fix problems with templates Jul 11, 2012
README.rst Merged hvad-nani refactor with master May 4, 2012
runtests.sh Merged hvad-nani refactor with master May 4, 2012
setup.py Import from new module May 4, 2012

README.rst

django-hvad

This project is yet another attempt at making model translations suck less in Django.

Documentation for django-hvad can be found at http://django-hvad.readthedocs.org/.

This project provides the same functionality as django-nani, but it as opposed to django-nani, this project does not affect the default queries, which means that everything will continue to work as it was before.

You have to activate the translated fields, by calling a specific method on the manager.

Warning

django-hvad is still in beta, please use it with caution and report any bug(s) you might encounter.

Feel free to join us at #django-hvad on irc.freenode.net for a chat

https://secure.travis-ci.org/KristianOellegaard/django-hvad.png?branch=master

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

Features

  • Simple API
  • Predictable
  • Reliable
  • Fast (few and simple queries)
  • High level (no custom SQL Compiler or other scary things)

Thanks to

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