web/__init__.py
branchtls-sprint
changeset 1801 672acc730ce5
parent 1645 374586978230
child 1977 606923dff11b
equal deleted inserted replaced
1800:05c36cf3c813 1801:672acc730ce5
    10 _ = unicode
    10 _ = unicode
    11 
    11 
    12 from decimal import Decimal
    12 from decimal import Decimal
    13 from datetime import datetime, date, timedelta
    13 from datetime import datetime, date, timedelta
    14 from simplejson import dumps
    14 from simplejson import dumps
       
    15 
       
    16 from logilab.common.deprecation import obsolete
    15 
    17 
    16 from cubicweb.common.uilib import urlquote
    18 from cubicweb.common.uilib import urlquote
    17 from cubicweb.web._exceptions import *
    19 from cubicweb.web._exceptions import *
    18 
    20 
    19 
    21 
    60 def jsonize(function):
    62 def jsonize(function):
    61     def newfunc(*args, **kwargs):
    63     def newfunc(*args, **kwargs):
    62         return json_dumps(function(*args, **kwargs))
    64         return json_dumps(function(*args, **kwargs))
    63     return newfunc
    65     return newfunc
    64 
    66 
       
    67 @obsolete('use req.build_ajax_replace_url() instead')
    65 def ajax_replace_url(nodeid, rql, vid=None, swap=False, **extraparams):
    68 def ajax_replace_url(nodeid, rql, vid=None, swap=False, **extraparams):
    66     """builds a replacePageChunk-like url
    69     """builds a replacePageChunk-like url
    67     >>> ajax_replace_url('foo', 'Person P')
    70     >>> ajax_replace_url('foo', 'Person P')
    68     "javascript: replacePageChunk('foo', 'Person%20P');"
    71     "javascript: replacePageChunk('foo', 'Person%20P');"
    69     >>> ajax_replace_url('foo', 'Person P', 'oneline')
    72     >>> ajax_replace_url('foo', 'Person P', 'oneline')