django-orchestra-test/orchestra/core/translations.py
2015-03-29 16:10:07 +00:00

14 lines
400 B
Python

class ModelTranslation(object):
"""
Collects all model fields that would be translated
using 'makemessages --domain database' management command
"""
_registry = {}
@classmethod
def register(cls, model, fields):
if model in cls._registry:
raise ValueError("Model %s already registered." % model.__name__)
cls._registry[model] = fields