Used get_language from modeltranslation.utils. Otherwise the returned language isn't guaranteed to be in the LANGUAGES setting and the manager might rewrite the field name to something like foo_en_us.

This commit is contained in:
Dirk Eschler 2012-11-13 13:31:00 +01:00
parent 5f7a292d6d
commit b2437741aa

View file

@ -6,10 +6,9 @@ https://github.com/zmathew/django-linguo
"""
from django.db import models
from django.db.models.fields.related import RelatedField
from django.utils.translation import get_language
from django.utils.tree import Node
from modeltranslation.utils import build_localized_fieldname
from modeltranslation.utils import build_localized_fieldname, get_language
from modeltranslation import settings