view.py
branchstable
changeset 5389 809d3b5b3d31
parent 5377 84d14ddfae13
child 5421 8167de96c523
--- a/view.py	Fri Apr 23 14:55:10 2010 +0200
+++ b/view.py	Fri Apr 23 12:19:54 2010 +0200
@@ -12,11 +12,7 @@
 from cStringIO import StringIO
 from warnings import warn
 
-try:
-    from json import dumps
-except ImportError:
-    from simplejson import dumps
-
+from cubicweb.utils import json
 from logilab.common.deprecation import deprecated
 from logilab.mtconverter import xml_escape
 
@@ -487,11 +483,11 @@
     def build_update_js_call(self, cbname, msg):
         rql = self.cw_rset.printable_rql()
         return "javascript:userCallbackThenUpdateUI('%s', '%s', %s, %s, '%s', '%s')" % (
-            cbname, self.id, dumps(rql), dumps(msg),
+            cbname, self.id, json.dumps(rql), json.dumps(msg),
             self.__registry__, self.div_id())
 
     def build_reload_js_call(self, cbname, msg):
-        return "javascript:userCallbackThenReloadPage('%s', %s)" % (cbname, dumps(msg))
+        return "javascript:userCallbackThenReloadPage('%s', %s)" % (cbname, json.dumps(msg))
 
     build_js = build_update_js_call # expect updatable component by default