diff -r f0bc8f5ddee2 -r 24cc5d495fdf web/facet.py --- a/web/facet.py Tue Jun 01 12:21:03 2010 +0200 +++ b/web/facet.py Tue Jun 01 12:21:44 2010 +0200 @@ -157,6 +157,10 @@ if rqlst.groupby: rqlst.add_group_var(newvar) rqlst.add_selected(newvar) + # add is restriction if necessary + if mainvar.stinfo['typerel'] is None: + etypes = frozenset(sol[mainvar.name] for sol in rqlst.solutions) + rqlst.add_type_restriction(mainvar, etypes) return newvar def _remove_relation(rqlst, rel, var): @@ -210,10 +214,6 @@ _set_orderby(rqlst, attrvar, sortasc, sortfuncname) # add attribute variable to selection rqlst.add_selected(attrvar) - # add is restriction if necessary - if mainvar.stinfo['typerel'] is None: - etypes = frozenset(sol[mainvar.name] for sol in rqlst.solutions) - rqlst.add_type_restriction(mainvar, etypes) return var def _cleanup_rqlst(rqlst, mainvar):