[Always OT] - wx.TreeCtrl and SQLAlchemy
Andrea Gavana
andrea.gavana at gmail.com
Tue Mar 6 13:48:29 PST 2007
Hi All,
it seems like I am going further and further off topic, but I
promise it won't happen anymore. I have already abused of your
patience.
I have been fighting against this problem for 2 days, searching back
and forth on the net. I have also written a couple of post in the
SQLAlchemy mailing list, but got no answer.
So I thought to ask few questions here, as I know that some of you
work with databases and few also with SQLAlchemy. But the database
itself is not that important, as the issue I am fighting with is
mainly related to the fact that there are very few examples of
tree-structured like databases in Python out there.
So, for those who know SQLAlchemy, I tried the sample called
"byroot_tree.py" in the examples/adjacencytree directory. Well, it
looks like SQLAlchemy can retrieve all the items in the tree based on
the item id, but it's impossible to do it using the item *names*, in
which I am much more interested. In other words, the statement:
session.query(TreeNode).select(TreeNode.c.name=="MyCustomName")
Returns always an empty list except when the name is the root item
name. So it seems impossible to query data by name, by size, by
whatever else I will put in the database, except the id.
I know it is a too much specific question, so I may come up with a
simpler (?) one: does anyone have an example of a way to populate a
wx.TreeCtrl using a tree-structured database? I have received a lot of
help from Werner, but I am afraid my knowledge of Python is way too
scarce to understand what he has done.
Thank you for your hints, and sorry for the noise.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
More information about the wxpython-users
mailing list