web/facet.py
branchstable
changeset 7204 2b6d3c9455a7
parent 7203 e0e802afa8e1
child 7205 9220ae2cacf1
equal deleted inserted replaced
7203:e0e802afa8e1 7204:2b6d3c9455a7
   926 
   926 
   927     .. _jquery: http://www.jqueryui.com/
   927     .. _jquery: http://www.jqueryui.com/
   928     """
   928     """
   929     attrtype = 'Float' # only numerical types are supported
   929     attrtype = 'Float' # only numerical types are supported
   930 
   930 
   931     wdgclass = FacetRangeWidget
   931     @property
       
   932     def wdgclass(self):
       
   933         return FacetRangeWidget
   932 
   934 
   933     def get_widget(self):
   935     def get_widget(self):
   934         """return the widget instance to use to display this facet"""
   936         """return the widget instance to use to display this facet"""
   935         values = set(value for _, value in self.vocabulary() if value is not None)
   937         values = set(value for _, value in self.vocabulary() if value is not None)
   936         # Rset with entities (the facet is selected) but without values
   938         # Rset with entities (the facet is selected) but without values
   971 
   973 
   972     .. image:: ../images/facet_date_range.png
   974     .. image:: ../images/facet_date_range.png
   973     """
   975     """
   974     attrtype = 'Date' # only date types are supported
   976     attrtype = 'Date' # only date types are supported
   975 
   977 
   976     wdgclass = DateFacetRangeWidget
   978     @property
       
   979     def wdgclass(self):
       
   980         return DateFacetRangeWidget
   977 
   981 
   978     def formatvalue(self, value):
   982     def formatvalue(self, value):
   979         """format `value` before in order to insert it in the RQL query"""
   983         """format `value` before in order to insert it in the RQL query"""
   980         try:
   984         try:
   981             date_value = ticks2datetime(float(value))
   985             date_value = ticks2datetime(float(value))