Django 4
[fnpdjango.git] / fnpdjango / utils / settings.py
index 39b0a25..b6df2b3 100644 (file)
@@ -1,9 +1,10 @@
 """
 Utilities for global settings.
 """
+from django.utils.functional import Promise
 
 
-class LazyUGettextLazy(object):
+class LazyUGettextLazy(Promise):
     """You can use it to internationalize strings in settings.
 
     Just import this class as gettext.
@@ -14,11 +15,11 @@ class LazyUGettextLazy(object):
     def __init__(self, text):
         self.text = text
 
-    def __unicode__(self):
+    def __str__(self):
         if not self.real:
-            from django.utils.translation import ugettext_lazy
-            LazyUGettextLazy._ = staticmethod(ugettext_lazy)
+            from django.utils.translation import gettext_lazy
+            LazyUGettextLazy._ = staticmethod(gettext_lazy)
             LazyUGettextLazy.real = True
-        return unicode(self._(self.text))
+        return str(self._(self.text))