[pygtk] treestore sqlalchemy examples
Alessandro Dentella
sandro at e-den.it
Wed Sep 23 06:16:44 WST 2009
> I like it for extensibility and mapping to complex sql schema's, but
> I was thinking if I could map all columns of a treeview and an extra
> column for the path. The path could then be applied to create the
in the first, non public, release of sqlkit I used a 1:1 mapping between
liststore (I don't currently use treestores) and it turned out to be slower.
Ythe reason is that in that case, you have to distribute the data you get
from the class to the model for all values of the model, while I let the
column's cell_data_function to do it just for the visible cells.
> I am trying to determine if this might be a better
> fit for small apps. It will keep the data storage in the same "shape"
> that the widget uses, and keep it simple so I do not get confused :)
I personally don't find it's simpler, the class that sqlalchemy returns it's
a pretty easy object to work with, it's normally in the session and you
don't have to retrieve the data from the TreeModel to check if it's changed,
you just check session.dirty, maybe session.is_modified(obj).
I'd really suggest you check why you consider it more natural, you're using
an ORM that is exactly the way to use the *record* in an object oriented way,
not in a tabular way...
sandro
*:-)
--
Sandro Dentella *:-)
http://sqlkit.argolinux.org SQLkit home page - PyGTK/python/sqlalchemy
More information about the pygtk
mailing list