traitsui.table_filter module¶
Defines the filter object used to filter items displayed in a table editor.
- class traitsui.table_filter.EvalTableFilter[source]¶
Bases:
TableFilter
A table filter based on evaluating an expression.
- description()[source]¶
Returns a user readable description of what kind of object satisfies the filter.
- expression = Expression¶
Python expression which will be applied to each table item
- name = "Default evaluation filter"¶
Override the standard name trait
- class traitsui.table_filter.GenericTableFilterRule(**traits)[source]¶
Bases:
HasPrivateTraits
A general rule used by a table filter.
- and_or = Enum("and", "or")¶
Is this rule an ‘and’ rule or an ‘or’ rule?
- clone_traits(traits=None, memo=None, copy=None, **metadata)[source]¶
Clones a new object from this one, optionally copying only a specified set of traits.
- enabled = Bool(False)¶
Is this rule enabled?
- filter = Instance("RuleTableFilter")¶
Filter this rule is part of
- ignored_traits = ['filter', 'name_editor', 'value_editor']¶
Traits that are ignored by the _anytrait_changed() handler
- name = Str()¶
Name of the object trait that this rule applies to
- name_editor = Instance(EditorFactory)¶
EnumEditor used to edit the name trait:
- operation = GenericTableFilterRuleOperation¶
Operation to be applied in the rule
- value = Any()¶
Value to use in the operation when applying the rule to an object
- value_editor = Instance(EditorFactory)¶
Editor used to edit the value trait
- class traitsui.table_filter.GenericTableFilterRuleAndOrColumn[source]¶
Bases:
ObjectColumn
Table column that displays whether a filter rule is conjoining (‘and’) or disjoining (‘or’).
- class traitsui.table_filter.GenericTableFilterRuleEnabledColumn[source]¶
Bases:
ObjectColumn
Table column that indicates whether a filter rule is enabled.
- class traitsui.table_filter.GenericTableFilterRuleNameColumn[source]¶
Bases:
ObjectColumn
Table column for the name of an object trait.
- class traitsui.table_filter.GenericTableFilterRuleValueColumn[source]¶
Bases:
ObjectColumn
Table column for the value of an object trait.
- class traitsui.table_filter.MenuTableFilter[source]¶
Bases:
RuleTableFilter
A table filter based on a menu of rules.
- description()[source]¶
Returns a user8readable description of what kind of object satisfies the filter.
- name = "Default menu-based filter"¶
Overrides the default name trait
- view_id = Str("traitsui.table_filter.MenuTableFilter")¶
Overrides the persistence ID of the view
- class traitsui.table_filter.RuleTableFilter[source]¶
Bases:
TableFilter
A table filter based on rules.
- description()[source]¶
Returns a user-readable description of the kind of object that satisfies the filter.
- edit_view(object)[source]¶
Return a view to use for editing the filter.
The ‘’object’’ parameter is a sample object for the table that the filter will be applied to. It is supplied in case the filter needs to extract data or metadata from the object. If the table is empty, the ‘’object’’ argument is None.
- modified = Event()¶
Event fired when the contents of the filter have changed
- name = "Default rule-based filter"¶
Overrides the default name trait
- rules = List(GenericTableFilterRule)¶
List of the filter rules to be applied
- view_id = Str("traitsui.table_filter.RuleTableFilter")¶
Persistence ID of the view
- class traitsui.table_filter.TableFilter[source]¶
Bases:
HasPrivateTraits
Filter for items displayed in a table.
- allowed = Callable(lambda object: True, transient=True)¶
A callable function that returns whether the passed object is allowed by the filter
- desc = Str("All items")¶
A user-readable description of what kind of object satisfies the filter
- description()[source]¶
Returns a user-readable description of what kind of object satisfies the filter.
- edit_view(object)[source]¶
Return a view to use for editing the filter.
The ‘’object’’ parameter is a sample object for the table that the filter will be applied to. It is supplied in case the filter needs to extract data or metadata from the object. If the table is empty, the ‘’object’’ argument is None.
- ignored_traits = ['_name', 'template', 'desc']¶
Traits that are ignored by the _anytrait_changed() handler
- name = Str("Default filter")¶
UI name of this filter (so the user can identify it in the UI)
- template = Bool(False)¶
Is the filter a template (i.e., non-deletable, non-editable)?