Class s.g.b.s.SearchDialog(BasicDialog):

Part of stoqlib.gui.base.search View In Hierarchy

Known subclasses: stoqlib.gui.base.search.SearchEditor, stoqlib.gui.dialogs.tillhistory.TillHistoryDialog, stoqlib.gui.search.commissionsearch.CommissionSearch, stoqlib.gui.search.paymentsearch._BaseBillCheckSearch, stoqlib.gui.search.productsearch.ProductSearchQuantity, stoqlib.gui.search.receivingsearch.PurchaseReceivingSearch, stoqlib.gui.search.salesearch.DeliverySearch, stoqlib.gui.search.salesearch.SaleSearch, stoqlib.gui.search.tillsearch.TillFiscalOperationsSearch, stoqlib.gui.search.transfersearch.TransferOrderSearch

Base class for *all* the search dialogs, responsible for the list construction and "Filter" and "Clear" buttons management.

This class must be subclassed and its subclass *must* implement the methods 'get_columns' and 'get_query_and_args' (if desired, 'get_query_and_args' can be implemented in the user's slave class, so SearchDialog will get its slave instance and call the method directly). Its subclass also must implement a setup_slaves method and call its equivalent base class method as in:

>>> def setup_slave(self):
...    SearchDialog.setup_slaves(self)

or then, call it in its constructor, like:

>>> def __init__(self, *args):
...     SearchDialog.__init__(self)
Class Variablestablethe table type which we will query on to get the objects.
searchbar_labelslabels for SearchBar entry and date fields
searchbar_result_stringsa tuple where each item has a singular and a plural form for searchbar results label
advanced_searchIf the advanced search is enabled or disabled
Method __init__ A base class for search dialog inheritance
Method _setup_search_table Undocumented
Method _setup_selection_mode Undocumented
Method _setup_search Undocumented
Method _setup_details_slave Undocumented
Method set_details_button_sensitive Undocumented
Method set_print_button_sensitive Undocumented
Method get_selection Undocumented
Method confirm Undocumented
Method cancel Undocumented
Method set_table Undocumented
Method set_searchbar_labels Undocumented
Method set_searchbar_search_string Undocumented
Method set_result_strings Undocumented
Method set_text_field_columns See SearchSlaveDelegate.set_text_field_columns
Method disable_search_entry See SearchSlaveDelegate.disable_search_entry
Method add_filter See SearchSlaveDelegate.add_filter
Method row_activate This is called when an item in the results list is double clicked.
Method create_branch_filter Undocumented
Method _on_results__cell_edited Override this method on child when it's needed to perform some
Method _on_results__selection_changed Undocumented
Method _on_results__row_activated Undocumented
Method _has_rows Undocumented
Method create_filters Undocumented
Method setup_widgets Undocumented
Method get_columns Undocumented
Method update_widgets Subclass can have an 'update_widgets', and this method will be

Inherited from BasicDialog:

Method _initialize Undocumented
Method setup_keyactions Undocumented
Method hide_footer Undocumented
Method enable_ok Undocumented
Method disable_ok Undocumented
Method set_ok_label Undocumented
Method set_cancel_label Undocumented
Method justify_label Undocumented
Method set_confirm_widget Enables widget as a confirm widget, the dialog will be closed as
Method set_cancel_widget Enables widget as a cancel widget, the dialog will be closed as
Method add Undocumented
Method action_area Undocumented
Method on_ok_button__clicked Undocumented
Method on_cancel_button__clicked Undocumented

Inherited from RunnableView (via BasicDialog, AbstractDialog):

Method close Handles action to be performed when window is closed.
Method destroy Undocumented
Method run Handles action to be performed when window is opened. Defaults to
@argcheck(object, object, object, bool, basestring, int, bool)
def __init__(self, conn, table=None, search_table=None, hide_footer=True, title='', selection_mode=None, double_click_confirm=False):
A base class for search dialog inheritance
Parametersconn
table
editor_class
search_table
hide_footer
title
selection_mode
double_click_confirmIf double click a item in the list should automatically confirm
def _setup_search_table(self, table, search_table):
Undocumented
def _setup_selection_mode(self, selection_mode):
Undocumented
def _setup_search(self):
Undocumented
def _setup_details_slave(self):
Undocumented
@argcheck(bool)
def set_details_button_sensitive(self, value):
Undocumented
@argcheck(bool)
def set_print_button_sensitive(self, value):
Undocumented
def get_selection(self):
Undocumented
def confirm(self):
Undocumented
def cancel(self, *args):
Undocumented
def set_table(self, table):
Undocumented
def set_searchbar_labels(self, *args):
Undocumented
def set_searchbar_search_string(self, string):
Undocumented
def set_result_strings(self, *args):
Undocumented
def set_text_field_columns(self, columns):
See SearchSlaveDelegate.set_text_field_columns
def disable_search_entry(self):
See SearchSlaveDelegate.disable_search_entry
def add_filter(self, search_filter, position=SearchFilterPosition.BOTTOM, columns=None, callback=None):
See SearchSlaveDelegate.add_filter
def row_activate(self, obj):
This is called when an item in the results list is double clicked.
Parametersobjthe item that was double clicked.
def create_branch_filter(self, label=None):
Undocumented
def _on_results__cell_edited(self, results, obj, attr):
Override this method on child when it's needed to perform some tasks when editing a row.
def _on_results__selection_changed(self, results, selected):
Undocumented
def _on_results__row_activated(self, results, obj):
Undocumented
def _has_rows(self, results, obj):
Undocumented
def create_filters(self):
Undocumented
def setup_widgets(self):
Undocumented
def get_columns(self):
Undocumented
def update_widgets(self):
Subclass can have an 'update_widgets', and this method will be called when a signal is emitted by 'Filter' or 'Clear' buttons and also when a list item is selected.
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.