# HG changeset patch # User Sylvain Thénault # Date 1275485358 -7200 # Node ID 879590c52679b4f698a8db81e67aef787b03dd94 # Parent 56042c65d5118937d066f0bd46843097f873d06a# Parent 1e7c662bd6f83853587e70295646fcf0fd5d5c0f backport stable diff -r 56042c65d511 -r 879590c52679 cwconfig.py --- a/cwconfig.py Wed Jun 02 14:24:28 2010 +0200 +++ b/cwconfig.py Wed Jun 02 15:29:18 2010 +0200 @@ -1154,7 +1154,7 @@ def as_sql(self, backend, args): raise NotImplementedError('source only callback') - def source_execute(self, source, value): + def source_execute(self, source, session, value): fpath = source.binary_to_str(value) try: return Binary(fpath) diff -r 56042c65d511 -r 879590c52679 server/sources/rql2sql.py --- a/server/sources/rql2sql.py Wed Jun 02 14:24:28 2010 +0200 +++ b/server/sources/rql2sql.py Wed Jun 02 15:29:18 2010 +0200 @@ -72,7 +72,7 @@ FunctionDescr.update_cb_stack = default_update_cb_stack LENGTH = SQL_FUNCTIONS_REGISTRY.get_function('LENGTH') -def length_source_execute(source, value): +def length_source_execute(source, session, value): return len(value.getvalue()) LENGTH.source_execute = length_source_execute diff -r 56042c65d511 -r 879590c52679 test/unittest_entity.py --- a/test/unittest_entity.py Wed Jun 02 14:24:28 2010 +0200 +++ b/test/unittest_entity.py Wed Jun 02 15:29:18 2010 +0200 @@ -356,8 +356,15 @@ data_encoding=u'ascii', data_name=u'toto.py') from cubicweb import mttransforms if mttransforms.HAS_PYGMENTS_TRANSFORMS: - self.assertEquals(e.printable_value('data'), - '''
lambda x: 1
+            import pygments
+            if tuple(int(i) for i in pygments.__version__.split('.')[:2]) >= (1, 3):
+                self.assertEquals(e.printable_value('data'),
+                                  '''
lambda x: 1
+
+''') + else + self.assertEquals(e.printable_value('data'), + '''
lambda x: 1
 
''') else: diff -r 56042c65d511 -r 879590c52679 web/views/tableview.py --- a/web/views/tableview.py Wed Jun 02 14:24:28 2010 +0200 +++ b/web/views/tableview.py Wed Jun 02 15:29:18 2010 +0200 @@ -321,7 +321,7 @@ displayed with default restrictions set """ __regid__ = 'initialtable' - __select__ = nonempty_rset() & match_form_params('actualrql') + __select__ = nonempty_rset() # should not be displayed in possible view since it expects some specific # parameters title = None @@ -329,8 +329,12 @@ def call(self, title=None, subvid=None, headers=None, divid=None, displaycols=None, displayactions=None, mainindex=None): """Dumps a table displaying a composite query""" - actrql = self._cw.form['actualrql'] - self._cw.ensure_ro_rql(actrql) + try: + actrql = self._cw.form['actualrql'] + except KeyError: + actrql = self.cw_rset.printable_rql() + else: + self._cw.ensure_ro_rql(actrql) displaycols = self.displaycols(displaycols, headers) if displayactions is None and 'displayactions' in self._cw.form: displayactions = True