equal
deleted
inserted
replaced
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 |
19 |
20 __docformat__ = "restructuredtext en" |
20 __docformat__ = "restructuredtext en" |
|
21 |
|
22 from six import PY2 |
21 |
23 |
22 from logilab.mtconverter import xml_escape |
24 from logilab.mtconverter import xml_escape |
23 from logilab.common.registry import yes |
25 from logilab.common.registry import yes |
24 from logilab.common.deprecation import deprecated |
26 from logilab.common.deprecation import deprecated |
25 |
27 |
85 """execute rql if specified""" |
87 """execute rql if specified""" |
86 req = self._cw |
88 req = self._cw |
87 rql = req.form.get('rql') |
89 rql = req.form.get('rql') |
88 if rql: |
90 if rql: |
89 req.ensure_ro_rql(rql) |
91 req.ensure_ro_rql(rql) |
90 if not isinstance(rql, unicode): |
92 if PY2 and not isinstance(rql, unicode): |
91 rql = unicode(rql, req.encoding) |
93 rql = unicode(rql, req.encoding) |
92 pp = req.vreg['components'].select_or_none('magicsearch', req) |
94 pp = req.vreg['components'].select_or_none('magicsearch', req) |
93 if pp is not None: |
95 if pp is not None: |
94 return pp.process_query(rql) |
96 return pp.process_query(rql) |
95 if 'eid' in req.form and not isinstance(req.form['eid'], list): |
97 if 'eid' in req.form and not isinstance(req.form['eid'], list): |