web/facet.py
changeset 412 5b3fd2f2ce9b
parent 408 a8814ff6824e
child 446 3a3ab6bbccc5
--- a/web/facet.py	Wed Jan 14 17:16:15 2009 +0100
+++ b/web/facet.py	Wed Jan 14 17:16:33 2009 +0100
@@ -2,7 +2,7 @@
 a search
 
 :organization: Logilab
-:copyright: 2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+:copyright: 2008-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
@@ -19,7 +19,7 @@
 from rql import parse, nodes
 
 from cubicweb import Unauthorized, typed_eid
-from cubicweb.common.selectors import contextprop_selector, one_has_relation_selector
+from cubicweb.common.selectors import match_context_prop, one_has_relation
 from cubicweb.common.registerers import priority_registerer
 from cubicweb.common.appobject import AppRsetObject
 from cubicweb.common.utils import AcceptMixIn
@@ -226,6 +226,8 @@
         # we can also remove all variables which are linked to this variable
         # and have no path to the main variable
         for ovarname in linkedvars:
+            if ovarname == mainvar.name:
+                continue
             if not has_path(vargraph, ovarname, mainvar.name):
                 toremove.add(rqlst.defined_vars[ovarname])            
 
@@ -332,7 +334,7 @@
         
 
 class RelationFacet(VocabularyFacet):
-    __selectors__ = (one_has_relation_selector, contextprop_selector)
+    __selectors__ = (one_has_relation, match_context_prop)
     # class attributes to configure the relation facet
     rtype = None
     role = 'subject'