web/__init__.py
changeset 2613 5e19c2bb370e
parent 1977 606923dff11b
child 2788 8d3dbe577d3a
child 2934 cf4d39416fca
equal deleted inserted replaced
2612:c3059d308dc2 2613:5e19c2bb370e
    12 
    12 
    13 from decimal import Decimal
    13 from decimal import Decimal
    14 from datetime import datetime, date, timedelta
    14 from datetime import datetime, date, timedelta
    15 from simplejson import dumps
    15 from simplejson import dumps
    16 
    16 
    17 from logilab.common.deprecation import obsolete
    17 from logilab.common.deprecation import deprecated
    18 
    18 
    19 from cubicweb.common.uilib import urlquote
    19 from cubicweb.common.uilib import urlquote
    20 from cubicweb.web._exceptions import *
    20 from cubicweb.web._exceptions import *
    21 
    21 
    22 
    22 
    63 def jsonize(function):
    63 def jsonize(function):
    64     def newfunc(*args, **kwargs):
    64     def newfunc(*args, **kwargs):
    65         return json_dumps(function(*args, **kwargs))
    65         return json_dumps(function(*args, **kwargs))
    66     return newfunc
    66     return newfunc
    67 
    67 
    68 @obsolete('use req.build_ajax_replace_url() instead')
    68 @deprecated('use req.build_ajax_replace_url() instead')
    69 def ajax_replace_url(nodeid, rql, vid=None, swap=False, **extraparams):
    69 def ajax_replace_url(nodeid, rql, vid=None, swap=False, **extraparams):
    70     """builds a replacePageChunk-like url
    70     """builds a replacePageChunk-like url
    71     >>> ajax_replace_url('foo', 'Person P')
    71     >>> ajax_replace_url('foo', 'Person P')
    72     "javascript: replacePageChunk('foo', 'Person%20P');"
    72     "javascript: replacePageChunk('foo', 'Person%20P');"
    73     >>> ajax_replace_url('foo', 'Person P', 'oneline')
    73     >>> ajax_replace_url('foo', 'Person P', 'oneline')