Kelie wrote:
> Paul McNett <p <at> ulmcnett.com> writes:
>
>> You insert/delete from/into your DataSet, and then call grid.refresh().
>>
>
> thanks again John, Paul. what i'm trying to do is creating a 3-column grid on
> a
> form. the 1st column will be True/False checkboxes, and other two are strings.
> the grid data will be retrieved from a xml file, after user modifies the the
> data in grid, the xml file will be updated/saved. here are my questions: 1. is
> there any demo/sample for similar tasks available? 2. if not, would anyone
> recommend a xml package? i searched the pypi page and there are quite a few
> xml
> related packages listed, each assigned a score. how are these scores derived?
> what i'm trying to do should be straight forward, so maybe i should just use
> ElementTree that comes with python 2.5. i appreciate your input.
What you want to do is deserialize your data from the XML into a
sequence of dicts for the grid. Then when time to save the XML, you
serialize your data back into XML. I think ElementTree is a sane way to go.
Again, what the grid wants would be something like:
grid.DataSet = [{"boo": True, str1: "hello", str2: "there"},
{"boo": False, str1: "star", str2: "wars"},
{"boo": False, str1: "comedy", str2: "drama"}]
So a sequence of dicts, where each dict has the same keys. Each dict
represents a record, and each key/value pair represents a field. In the
example above, your grid would show three records.
--
pkm ~ http://paulmcnett.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users