web/facet.py
changeset 7609 fbefd1b9e587
parent 7608 47311917a548
child 7615 e5ad51352eb3
equal deleted inserted replaced
7608:47311917a548 7609:fbefd1b9e587
   987     .. image:: ../images/facet_range.png
   987     .. image:: ../images/facet_range.png
   988 
   988 
   989     .. _jquery: http://www.jqueryui.com/
   989     .. _jquery: http://www.jqueryui.com/
   990     """
   990     """
   991     attrtype = 'Float' # only numerical types are supported
   991     attrtype = 'Float' # only numerical types are supported
       
   992     needs_update = False # not supported actually
   992 
   993 
   993     @property
   994     @property
   994     def wdgclass(self):
   995     def wdgclass(self):
   995         return FacetRangeWidget
   996         return FacetRangeWidget
   996 
   997 
  1032         self.select.add_constant_restriction(self.filtered_variable,
  1033         self.select.add_constant_restriction(self.filtered_variable,
  1033                                              self.rtype,
  1034                                              self.rtype,
  1034                                              self.formatvalue(value),
  1035                                              self.formatvalue(value),
  1035                                              self.attrtype, operator)
  1036                                              self.attrtype, operator)
  1036 
  1037 
  1037     def possible_values(self):
       
  1038         # javascript don't know how to update the widget anyway
       
  1039         raise facet.DontUpdateFacet()
       
  1040 
  1038 
  1041 
  1039 
  1042 class DateRangeFacet(RangeFacet):
  1040 class DateRangeFacet(RangeFacet):
  1043     """This class works similarly as the :class:`RangeFacet` but for attribute
  1041     """This class works similarly as the :class:`RangeFacet` but for attribute
  1044     of date type.
  1042     of date type.
  1085     __select__ = partial_relation_possible() & match_context_prop()
  1083     __select__ = partial_relation_possible() & match_context_prop()
  1086     rtype = None # override me in subclass
  1084     rtype = None # override me in subclass
  1087     role = 'subject' # role of filtered entity in the relation
  1085     role = 'subject' # role of filtered entity in the relation
  1088 
  1086 
  1089     title = property(rtype_facet_title)
  1087     title = property(rtype_facet_title)
       
  1088     needs_update = False # not supported actually
  1090     support_and = False
  1089     support_and = False
  1091 
  1090 
  1092     def get_widget(self):
  1091     def get_widget(self):
  1093         return CheckBoxFacetWidget(self._cw, self,
  1092         return CheckBoxFacetWidget(self._cw, self,
  1094                                    '%s:%s' % (self.rtype, self),
  1093                                    '%s:%s' % (self.rtype, self),