Public Member Functions

Koo::Search::SearchFormWidget::SearchFormWidget Class Reference

This class provides a form with the fields to search given a model. More...

List of all members.

Public Member Functions

def __init__
 Constructs a new SearchFormWidget.
def isLoaded
 Returns True if it's been already loaded.
def isEmpty
 Returns True if it has no widgets.
def setup
 Initializes the widget with the appropiate widgets to search.
def showButtons
 Shows Search and Clear buttons.
def hideButtons
 Hides Search and Clear buttons.
def setFocus
 Sets the focus to the widget.
def clear
 Clears all search fields.
def value
 Returns a domain-like list for the current search parameters.
def setValue
 Allows setting filter values for all fields in the form.

Detailed Description

This class provides a form with the fields to search given a model.

This class will emit the 'search()' signal each time the user pushes the 'search' button. Then you can use the 'value()' function to obtain a domain-like list.

Definition at line 143 of file SearchFormWidget.py.


Member Function Documentation

def Koo::Search::SearchFormWidget::SearchFormWidget::__init__ (   self,
  parent = None 
)

Constructs a new SearchFormWidget.

Definition at line 145 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::clear (   self  ) 

Clears all search fields.

Calling 'value()' after this function should return an empty list.

Reimplemented from Koo::Search::AbstractSearchWidget::AbstractSearchWidget.

Definition at line 302 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::hideButtons (   self  ) 

Hides Search and Clear buttons.

Definition at line 263 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::isEmpty (   self  ) 

Returns True if it has no widgets.

Definition at line 172 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::isLoaded (   self  ) 

Returns True if it's been already loaded.

That is: setup has been called.

Definition at line 168 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::setup (   self,
  xml,
  fields,
  model,
  domain 
)

Initializes the widget with the appropiate widgets to search.

Needed fields include XML view (usually 'form'), fields dictionary with information such as names and types, and the model parameter.

Definition at line 182 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::setValue (   self,
  val 
)

Allows setting filter values for all fields in the form.

'val' parameter should be a dictionary with field names as keys and field values as values. Example:

form.setValue({ 'name': 'enterprise', 'income': 24 })

Reimplemented from Koo::Search::AbstractSearchWidget::AbstractSearchWidget.

Definition at line 338 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::showButtons (   self  ) 

Shows Search and Clear buttons.

Definition at line 258 of file SearchFormWidget.py.

def Koo::Search::SearchFormWidget::SearchFormWidget::value (   self,
  domain = [] 
)

Returns a domain-like list for the current search parameters.

Note you can optionally give a 'domain' parameter which will be added to the filters the widget will return.

Definition at line 313 of file SearchFormWidget.py.


The documentation for this class was generated from the following file:
Generated by Doxygen