cubicweb/web/controller.py
changeset 12567 26744ad37953
parent 12503 b01dd0ef43aa
equal deleted inserted replaced
12566:6b3523f81f42 12567:26744ad37953
    14 # details.
    14 # details.
    15 #
    15 #
    16 # You should have received a copy of the GNU Lesser General Public License along
    16 # You should have received a copy of the GNU Lesser General Public License along
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    17 # with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
    18 """abstract controller classe for CubicWeb web client"""
    18 """abstract controller classe for CubicWeb web client"""
    19 
       
    20 
       
    21 
       
    22 from six import PY2
       
    23 
    19 
    24 from logilab.mtconverter import xml_escape
    20 from logilab.mtconverter import xml_escape
    25 from logilab.common.registry import yes
    21 from logilab.common.registry import yes
    26 
    22 
    27 from cubicweb.appobject import AppObject
    23 from cubicweb.appobject import AppObject
    86         """execute rql if specified"""
    82         """execute rql if specified"""
    87         req = self._cw
    83         req = self._cw
    88         rql = req.form.get('rql')
    84         rql = req.form.get('rql')
    89         if rql:
    85         if rql:
    90             req.ensure_ro_rql(rql)
    86             req.ensure_ro_rql(rql)
    91             if PY2 and not isinstance(rql, unicode):
       
    92                 rql = unicode(rql, req.encoding)
       
    93             pp = req.vreg['components'].select_or_none('magicsearch', req)
    87             pp = req.vreg['components'].select_or_none('magicsearch', req)
    94             if pp is not None:
    88             if pp is not None:
    95                 return pp.process_query(rql)
    89                 return pp.process_query(rql)
    96         if 'eid' in req.form and not isinstance(req.form['eid'], list):
    90         if 'eid' in req.form and not isinstance(req.form['eid'], list):
    97             return req.eid_rset(req.form['eid'])
    91             return req.eid_rset(req.form['eid'])