Package Camelot :: Package camelot :: Package view :: Module filters :: Class Filter |
[frames] | no frames]

# Class Filter

source code

Base class for filters

Instance Methods
__init__(self, attribute, value_to_string=<function <lambda> at 0xb95f614>) @param attribute: the attribute on which to filter, this attribute may contain dots to indicate relationships that need to be followed, eg. 'person.groups.name' @param value_to_string: function that converts a value of the attribute to a string that will be displayed in the filter | source code
render(*args, **kwargs) Render this filter as a qt object @param parent: its parent widget @param name: the name of the filter @param options: the options that can be selected, where each option is a list of tuples containting (option_name, query_decorator) | source code
get_name_and_options(self, admin) return a tuple of the name of the filter and a list of options that can be selected. Each option is a tuple of the name of the option, and a filter function to decorate a query @return: (filter_name, [(option_name, query_decorator), ...) | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, attribute, value_to_string=<function <lambda> at 0xb95f614>) (Constructor) | source code
@param attribute: the attribute on which to filter, this attribute may contain dots to indicate relationships that need to be followed, eg. 'person.groups.name' @param value_to_string: function that converts a value of the attribute to a string that will be displayed in the filter Overrides: object.__init__

### render(*args, **kwargs) | source code
Render this filter as a qt object @param parent: its parent widget @param name: the name of the filter @param options: the options that can be selected, where each option is a list of tuples containting (option_name, query_decorator) The name and the list of options can be fetched with get_name_and_options Decorators: `@gui_function`