commit patch from issue : http://code.google.com/p/django-modeltranslation/issues/detail?id=1 V00.03
authorymh <ymh.work@gmail.com>
Fri, 22 Jan 2010 04:15:42 +0100
changeset 9 60555e0d17f4
parent 8 e68b76e3ad73
child 10 7207a5a27b8f
commit patch from issue : http://code.google.com/p/django-modeltranslation/issues/detail?id=1
web/blinkster/__init__.py
web/blinkster/models.py
web/lib/modeltranslation/translator.py
--- a/web/blinkster/__init__.py	Fri Jan 22 02:46:03 2010 +0100
+++ b/web/blinkster/__init__.py	Fri Jan 22 04:15:42 2010 +0100
@@ -1,3 +1,3 @@
-VERSION = (0,2)
+VERSION = (0,3)
 
 VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION)))
--- a/web/blinkster/models.py	Fri Jan 22 02:46:03 2010 +0100
+++ b/web/blinkster/models.py	Fri Jan 22 04:15:42 2010 +0100
@@ -5,9 +5,7 @@
 import uuid
 import photologue.models
 from django.conf import settings
-
-def build_localized_fieldname(field_name, lang):
-    return '%s_%s' % (field_name, lang)
+from modeltranslation.utils import build_localized_fieldname
 
 def get_sid():
     return unicode(uuid.uuid1())
--- a/web/lib/modeltranslation/translator.py	Fri Jan 22 02:46:03 2010 +0100
+++ b/web/lib/modeltranslation/translator.py	Fri Jan 22 04:15:42 2010 +0100
@@ -1,5 +1,5 @@
 from django.conf import settings
-from django.contrib.contenttypes.models import ContentType
+#from django.contrib.contenttypes.models import ContentType
 from django.db import models
 from django.db.models import signals
 from django.db.models.base import ModelBase
@@ -25,8 +25,8 @@
     on.
     """
     def __init__(self, *args, **kwargs):
-        # self.translation_model = None        
-        self.model_ct = None
+        # self.translation_model = None
+        #self.model_ct = None
         self.localized_fieldnames = list()
         
 #def get_localized_fieldnames(model):
@@ -123,11 +123,11 @@
             #validate(translation_opts, model)
 
             # Store the translation class associated to the model
-            self._registry[model] = translation_opts    
+            self._registry[model] = translation_opts
                     
             # Get the content type of the original model and store it on the
             # translation options for faster lookup later on.
-            translation_opts.model_ct = ContentType.objects.get_for_model(model)                    
+            #translation_opts.model_ct = ContentType.objects.get_for_model(model)                    
                                        
             # Add the localized fields to the model and store the names of these
             # fields in the model's translation options for faster lookup later