[pygtk] treestore sqlalchemy examples
Alessandro Dentella
sandro at e-den.it
Tue Sep 22 21:24:17 WST 2009
On Tue, Sep 22, 2009 at 08:26:01PM +1000, Kim Adil wrote:
> Has anyone seen any good, small examples using gtktreestores and
> sqlalchemy. SQLKit is the obvious big example, but I cannot seem to find
> any small samples, yet they like an seem ideal combination.
It really depends on the fact that you simply want to show data or edit them.
I'm not in the mood to produce a small exmaple but I can tell you which is
the idea behind sqlkit way of populating the treeview from the sqlalchemy
result.
The treeview has only one column, that holds the instance returned by
sqlalchemy query. Each column has a cell_data_function that populates the
cell renderers. Each column is specialized to handle a type of data
according to specification desumed by information gathered from the
__mapper__ of the result.
If you want to understand how I cope with different data you should read
sqlkit.widgets.table.columns.py [1]. It's more complicated than what is
needed to just show data as it has calls to validation function hat
complicates the game quite a bit.
sandro
*:-)
[1] http://hg.argolinux.org/py/sqlkit/file/230d6baaf634/sqlkit/widgets/table/columns.py
--
Sandro Dentella *:-)
http://sqlkit.argolinux.org SQLkit home page - PyGTK/python/sqlalchemy
More information about the pygtk
mailing list