Ticket #5560: lazy_unicode.patch
File lazy_unicode.patch, 1022 bytes (added by , 17 years ago) |
---|
-
django/utils/functional.py
53 53 self._delegate_unicode = unicode in resultclasses 54 54 assert not (self._delegate_str and self._delegate_unicode), "Cannot call lazy() with both str and unicode return types." 55 55 if self._delegate_unicode: 56 self.__unicode__ = self.__unicode_cast 56 # Assigning the __unicode__ method to the __proxy__ class, 57 # for Jython compatibility (where __unicode__ lives on object) 58 # 59 # As each call to lazy() makes a new __proxy__ class, 60 # this don't interfere with other lazy objects 61 __proxy__.__unicode__ = __proxy__.__unicode_cast 57 62 58 63 def __promise__(self, klass, funcname, func): 59 64 # Builds a wrapper around some magic method and registers that magic