Package pysqlgtk :: Module models :: Class SqlListModel
[hide private]
[frames] | no frames]

Class SqlListModel

source code

            object --+        
                     |        
       gobject.GObject --+    
                         |    
        object --+       |    
                 |       |    
gobject.GInterface --+   |    
                     |   |    
         gtk.TreeModel --+    
                         |    
      gtk.GenericTreeModel --+
                             |
                            SqlListModel

a Treemodel that can be used with gtk.TreeView. This model helps combining the power of SQLObject and pygtk

Instance Methods [hide private]
 
__init__(self, sql_object)
The constructor takes a SQLObject Class (not an Instance!) as only argument.
source code
 
on_get_flags(self) source code
 
on_get_n_columns(self)
returns the number of cols of the model
source code
 
on_get_column_type(self, n) source code
 
on_get_iter(self, path) source code
 
on_get_path(self, rowref) source code
 
on_get_value(self, rowref, column) source code
 
on_iter_next(self, rowref) source code
 
on_iter_children(self, rowref) source code
 
on_iter_has_child(self, rowref) source code
 
on_iter_n_children(self, rowref) source code
 
on_iter_nth_child(self, rowref, n) source code
 
on_iter_parent(child) source code
 
get_col_by_attr(self, col_name) source code
 
iter_previous(self, iter)
in order to be able to navigate forward and backward through the list, this method has been added to complement <i>iter_next()</i>.
source code
 
refresh(self, *value)
fills the list with instances.
source code
 
flush(self)
flushes the argument buffer that keeps the last used argument with refresh().
source code
 
add_row(self, **values)
Creates a new SqlObject instance and appends it to the model, no matter if it complies with the last used select parameters.
source code
 
change_row(self, iter, **values) source code
 
get_row(self, iter) source code
 
del_row(self, iter) source code

Inherited from gtk.GenericTreeModel: __delitem__, __getitem__, __iter__, __len__, __nonzero__, __setitem__, create_tree_iter, get_user_data, invalidate_iters, iter_is_valid

Inherited from gobject.GObject: __cmp__, __delattr__, __gdoc__, __gobject_init__, __hash__, __new__, __repr__, __setattr__, chain, connect, connect_after, connect_object, connect_object_after, disconnect, disconnect_by_func, emit, emit_stop_by_name, freeze_notify, get_data, get_properties, get_property, handler_block, handler_block_by_func, handler_disconnect, handler_is_connected, handler_unblock, handler_unblock_by_func, notify, props, set_data, set_properties, set_property, stop_emission, thaw_notify, weak_ref

Inherited from gtk.TreeModel: do_get_column_type, do_get_flags, do_get_iter, do_get_n_columns, do_get_path, do_iter_children, do_iter_has_child, do_iter_n_children, do_iter_next, do_iter_nth_child, do_iter_parent, do_ref_node, do_row_changed, do_row_deleted, do_row_has_child_toggled, do_row_inserted, do_unref_node, filter_new, foreach, get, get_column_type, get_flags, get_iter, get_iter_first, get_iter_from_string, get_iter_root, get_n_columns, get_path, get_string_from_iter, get_value, iter_children, iter_has_child, iter_n_children, iter_next, iter_nth_child, iter_parent, ref_node, row_changed, row_deleted, row_has_child_toggled, row_inserted, rows_reordered, unref_node

Inherited from object: __getattribute__, __reduce__, __reduce_ex__, __str__

Class Variables [hide private]
  select_list = []
  select_args = None
  sql_object = None
  __where_clause = ()

Inherited from gtk.GenericTreeModel: __gtype__

Properties [hide private]

Inherited from gobject.GObject: __grefcount__

Inherited from object: __class__

Method Details [hide private]

__init__(self, sql_object)
(Constructor)

source code 
The constructor takes a SQLObject Class (not an Instance!) as only argument. However, the model does not contain any data yet on construction time. To fill the model with data you have to call the method <i>refresh()</i>
Overrides: gtk.GenericTreeModel.__init__

refresh(self, *value)

source code 
fills the list with instances. Arguments are like in SQLObject.select(). If no argument is given, the last used arguments are used. To make a full select, call flush before refresh

add_row(self, **values)

source code 
Creates a new SqlObject instance and appends it to the model, no matter if it complies with the last used select parameters. The parameters are just the same as if for the corresponding SqlObject class.