uilib.py
changeset 7914 fb757a7d887e
parent 7913 d0c6a7993cec
child 7971 3e51c2a577dd
--- a/uilib.py	Thu Oct 06 16:14:08 2011 +0200
+++ b/uilib.py	Thu Oct 06 16:14:08 2011 +0200
@@ -30,6 +30,7 @@
 
 from logilab.mtconverter import xml_escape, html_unescape
 from logilab.common.date import ustrftime
+from logilab.common.deprecation import deprecated
 
 from cubicweb.utils import JSString, json_dumps
 
@@ -134,15 +135,9 @@
     'Interval': print_timedelta,
     }
 
+@deprecated('[3.14] use req.printable_value(attrtype, value, ...)')
 def printable_value(req, attrtype, value, props=None, displaytime=True):
-    """return a displayable value (i.e. unicode string)"""
-    if value is None:
-        return u''
-    try:
-        printer = PRINTERS[attrtype]
-    except KeyError:
-        return unicode(value)
-    return printer(value, req, props, displaytime)
+    return req.printable_value(attrtype, value, props, displaytime)
 
 
 # text publishing #############################################################