filter_operator

class camelot.view.controls.filter_operator.FilterOperator(cls, field_name, field_attributes, default_operator=None, default_value_1=None, default_value_2=None, parent=None)[source]

Widget that allows applying various filter operators on a field

Parameters:
  • cls – the class on which the filter will be applied
  • field_name – the name fo the field on the class on which to filter
  • field_attributes – a dictionary of field attributes for this filter
  • default_operator – a default operator to be used, on of the attributes of the python module operator, such as operator.eq
  • default_value_1 – a default value for the first editor (in case the default operator in unary or binary
  • default_value_2 – a default value for the second editor (in case the default operator is binary)
  • parent – the parent QtGui.QWidget
combobox_changed(index)[source]

Whenever the combobox changes, show or hide the appropriate editors and emit the filter_changed signal

decorate_query(query)[source]
Parameters:query – an sqlalchemy query
Returns:the input query transformed to take into account the filter of

this widget

editor_editing_finished()[source]

Whenever one of the editors their value changes, emit the filters changed signal

get_operator_and_arity()[source]
Returns:the current operator and its arity
update_editors()[source]

Show or hide the editors according to the operator arity

Previous topic

field_label

Next topic

filterlist

This Page