# HG changeset patch # User Sylvain Thénault # Date 1246367887 -7200 # Node ID efdd3a9f902858aefa8e94fa2e43eaa3f42c4c55 # Parent cb374512949f1031e90bb450ac4470f8e03e3040 update to new rql get_description api diff -r cb374512949f -r efdd3a9f9028 common/__init__.py --- a/common/__init__.py Tue Jun 30 08:05:57 2009 +0200 +++ b/common/__init__.py Tue Jun 30 15:18:07 2009 +0200 @@ -18,9 +18,9 @@ rtype = 'String' @classmethod - def st_description(cls, funcnode): - return ', '.join(term.get_description() - for term in iter_funcnode_variables(funcnode)) + def st_description(cls, funcnode, mainindex, tr): + return ', '.join(sorted(term.get_description(mainindex, tr) + for term in iter_funcnode_variables(funcnode))) register_function(COMMA_JOIN) # XXX do not expose? @@ -41,8 +41,8 @@ rtype = 'String' @classmethod - def st_description(cls, funcnode): - return funcnode.children[0].get_description() + def st_description(cls, funcnode, mainindex, tr): + return funcnode.children[0].get_description(mainindex, tr) register_function(LIMIT_SIZE) diff -r cb374512949f -r efdd3a9f9028 debian/control --- a/debian/control Tue Jun 30 08:05:57 2009 +0200 +++ b/debian/control Tue Jun 30 15:18:07 2009 +0200 @@ -76,7 +76,7 @@ Package: cubicweb-common Architecture: all XB-Python-Version: ${python:Versions} -Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.41.0), python-yams (>= 0.23.0), python-rql (>= 0.22.0) +Depends: ${python:Depends}, graphviz, gettext, python-logilab-mtconverter (>= 0.6.0), python-logilab-common (>= 0.41.0), python-yams (>= 0.23.0), python-rql (>= 0.22.1) Recommends: python-simpletal (>= 4.0), python-lxml Conflicts: cubicweb-core Replaces: cubicweb-core diff -r cb374512949f -r efdd3a9f9028 view.py --- a/view.py Tue Jun 30 08:05:57 2009 +0200 +++ b/view.py Tue Jun 30 15:18:07 2009 +0200 @@ -369,20 +369,20 @@ category = 'anyrsetview' - def columns_labels(self, tr=True): + def columns_labels(self, mainindex=0, tr=True): if tr: translate = display_name else: translate = lambda req, val: val - rqlstdescr = self.rset.syntax_tree().get_description()[0] # XXX missing Union support + # XXX [0] because of missing Union support + rqlstdescr = self.rset.syntax_tree().get_description(mainindex, + translate)[0] labels = [] - for colindex, attr in enumerate(rqlstdescr): + for colindex, label in enumerate(rqlstdescr): # compute column header - if colindex == 0 or attr == 'Any': # find a better label + if label == 'Any': # find a better label label = ','.join(translate(self.req, et) for et in self.rset.column_types(colindex)) - else: - label = translate(self.req, attr) labels.append(label) return labels