Package pyamf :: Package adapters :: Module _django_utils_translation
[hide private]
[frames] | no frames]

Source Code for Module pyamf.adapters._django_utils_translation

 1  # Copyright (c) 2007-2009 The PyAMF Project. 
 2  # See LICENSE for details. 
 3   
 4  """ 
 5  C{django.utils.translation} adapter module. 
 6   
 7  @see: U{Django Project<http://www.djangoproject.com>} 
 8  @since: 0.5 
 9  """ 
10   
11  from django.utils.translation import ugettext_lazy 
12   
13  import pyamf 
14   
15 -def convert_lazy(l, encoder=None):
16 if l.__class__._delegate_unicode: 17 return unicode(l) 18 19 if l.__class__._delegate_str: 20 return str(l) 21 22 raise ValueError('Don\'t know how to convert lazy value %s' % (repr(l),))
23 24 pyamf.add_type(type(ugettext_lazy('foo')), convert_lazy) 25