xmpp.chapril.org-conversejs/trans/managers.py
2012-02-27 16:09:31 +01:00

18 lines
498 B
Python

from django.db import models
from lang.models import Language
class TranslationManager(models.Manager):
def update_from_blob(self, subproject, code, path, blob):
'''
Parses translation meta info and creates/updates translation object.
'''
print code
lang = Language.objects.get(code = code)
trans, created = self.get_or_create(
language = lang,
subproject = subproject,
filename = path)
print trans