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

Class EditorFilter

source code


Filter that presents the user with an editor, allowing the user to enter a value on which to filter, and at the same time to show 'All' or 'None'
Instance Methods
 
__init__(self, field_name, verbose_name=None)
@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(self, parent, name, options)
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, field_name, verbose_name=None)
(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
Parameters:
  • field - the name of the field on which to filter
Overrides: object.__init__

render(self, parent, name, options)

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

Overrides: Filter.render
(inherited documentation)

get_name_and_options(self, admin)

source code 
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), ...)
Overrides: Filter.get_name_and_options
(inherited documentation)