On Oct 2, 2009, at 6:46 PM, Ricardo Aráoz wrote:
> I can see that ds = dabo.db.dDataSet() returns a dataset object, but I
> wasn't able to find out how to define it's structure and generally
> work
> with it.
A dabo.db.dDataSet is simply a subclass of tuple. A record is best
represented as a Python dict, with column names as keys and values as
the, well, values. A set of records is a tuple of these dicts, where
every record has the same keys and same data types for each key value.
The dDataSet class wraps that with some additional capabilities.
To create one, it's pretty straightforward: create a tuple (or even a
list) of dicts, and pass that to the dDataSet constructor. E.g.:
recs = ({"foo": 1, "bar": "something"},
{"foo": 2, "bar": "else"})
ds = dabo.db.dDataSet(recs)
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]