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

Class Filter

source code


Base class for filters

Instance Methods [hide private]
 
__init__(self, attribute, value_to_string=<function <lambda> at 0x9a62aac>)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
render(self, parent, name, options)
Render this filter as a qt object
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.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, attribute, value_to_string=<function <lambda> at 0x9a62aac>)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • attribute - the attribute on which to filter, this attribute may contain dots to indicate relationships that need to be followed, eg. 'person.groups.name'
  • 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(self, parent, name, options)

source code 

Render this filter as a qt object

Parameters:
  • parent - its parent widget
  • name - the name of the filter
  • 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

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

Returns:
(filter_name, [(option_name, query_decorator), ...)