--- a/web/facet.py Wed Feb 17 10:39:35 2010 +0100
+++ b/web/facet.py Wed Feb 17 15:57:03 2010 +0100
@@ -268,25 +268,16 @@
needs_update = False
start_unfolded = True
- def __init__(self, req, rset=None, rqlst=None, filtered_variable=None,
+ def __init__(self, req, rqlst=None, filtered_variable=None,
**kwargs):
- super(AbstractFacet, self).__init__(req, rset=rset, **kwargs)
- assert rset is not None or rqlst is not None
+ super(AbstractFacet, self).__init__(req, **kwargs)
+ assert rqlst is not None
assert filtered_variable
- # facet retreived using `object_by_id` from an ajax call
- if rset is None:
- self.init_from_form(rqlst=rqlst)
- # facet retreived from `select` using the result set to filter
- else:
- self.init_from_rset()
+ # take care: facet may be retreived using `object_by_id` from an ajax call
+ # or from `select` using the result set to filter
+ self.rqlst = rqlst
self.filtered_variable = filtered_variable
- def init_from_rset(self):
- self.rqlst = self.cw_rset.syntax_tree().children[0]
-
- def init_from_form(self, rqlst):
- self.rqlst = rqlst
-
@property
def operator(self):
# OR between selected values by default