web/facet.py
branchstable
changeset 7203 e0e802afa8e1
parent 7117 44775b275d45
child 7204 2b6d3c9455a7
equal deleted inserted replaced
7202:5b80f5ee61b5 7203:e0e802afa8e1
   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     @property
   931     wdgclass = FacetRangeWidget
   932     def wdgclass(self):
       
   933         return FacetRangeWidget
       
   934 
   932 
   935     def get_widget(self):
   933     def get_widget(self):
   936         """return the widget instance to use to display this facet"""
   934         """return the widget instance to use to display this facet"""
   937         values = set(value for _, value in self.vocabulary() if value is not None)
   935         values = set(value for _, value in self.vocabulary() if value is not None)
   938         # Rset with entities (the facet is selected) but without values
   936         # Rset with entities (the facet is selected) but without values
   973 
   971 
   974     .. image:: ../images/facet_date_range.png
   972     .. image:: ../images/facet_date_range.png
   975     """
   973     """
   976     attrtype = 'Date' # only date types are supported
   974     attrtype = 'Date' # only date types are supported
   977 
   975 
   978     @property
   976     wdgclass = DateFacetRangeWidget
   979     def wdgclass(self):
       
   980         return DateFacetRangeWidget
       
   981 
   977 
   982     def formatvalue(self, value):
   978     def formatvalue(self, value):
   983         """format `value` before in order to insert it in the RQL query"""
   979         """format `value` before in order to insert it in the RQL query"""
   984         try:
   980         try:
   985             date_value = ticks2datetime(float(value))
   981             date_value = ticks2datetime(float(value))