web/facet.py
changeset 8696 0bb18407c053
parent 8598 95b3792a8947
child 8719 539ed3fb27cb
equal deleted inserted replaced
8695:358d8bed9626 8696:0bb18407c053
   152     # XXX remove aggregat from having
   152     # XXX remove aggregat from having
   153     # selection: only vocabulary entity
   153     # selection: only vocabulary entity
   154     for term in select.selection[:]:
   154     for term in select.selection[:]:
   155         select.remove_selected(term)
   155         select.remove_selected(term)
   156     # remove unbound variables which only have some type restriction
   156     # remove unbound variables which only have some type restriction
   157     for dvar in select.defined_vars.values():
   157     for dvar in list(select.defined_vars.itervalues()):
   158         if not (dvar is filtered_variable or dvar.stinfo['relations']):
   158         if not (dvar is filtered_variable or dvar.stinfo['relations']):
   159             select.undefine_variable(dvar)
   159             select.undefine_variable(dvar)
   160     # global tree config: DISTINCT, LIMIT, OFFSET
   160     # global tree config: DISTINCT, LIMIT, OFFSET
   161     select.set_distinct(True)
   161     select.set_distinct(True)
   162 
   162 
   301         return None
   301         return None
   302     if rel.optional in (opt, 'both'):
   302     if rel.optional in (opt, 'both'):
   303         # optional relation
   303         # optional relation
   304         return ovar
   304         return ovar
   305     if all(rdef.cardinality[cardidx] in '1+'
   305     if all(rdef.cardinality[cardidx] in '1+'
   306            for rdef in rschema.rdefs.values()):
   306            for rdef in rschema.rdefs.itervalues()):
   307         # mandatory relation without any restriction on the other variable
   307         # mandatory relation without any restriction on the other variable
   308         for orel in ovar.stinfo['relations']:
   308         for orel in ovar.stinfo['relations']:
   309             if rel is orel:
   309             if rel is orel:
   310                 continue
   310                 continue
   311             if _may_be_removed(orel, schema, ovar) is None:
   311             if _may_be_removed(orel, schema, ovar) is None: