On 2/10/12 5:16 AM, Ed Leafe wrote:
> On Feb 9, 2012, at 10:02 PM, Paul McNett wrote:
>
>> Add setDataSet() function to dCursor. Allows using the full cursor interface
>> which has useful methods like locate() and seek() when you happen to have
>> a dDataSet most likely gotten from cur.getDataSet().execute("select ...")
>
> Could we name this something different? The get*/set* paradigm doesn't
> really seem to apply here, as this is a destructive method that really
> doesn't work with the rest of the class (can't save/requery/etc), and doesn't
> necessarily have to match with Table, KeyField, and any other properties.
> Maybe something like 'overrideDataSet' or something? Or even better: instead
> of changing the current cursor, have it return a new cursor instance, similar
> to the AuxCursor.
Yes, I made this commit to generate discussion. I realized I could get around a
sub-aggregation problem I was having by issuing:
cur._records = cur.getDataSet().execute("select ... from dataset").
What (I think) I'd really like to see is dCursor and dDataSet merging, so that
when
you call getDataSet() you are returned a read-only dCursor instead of a raw
dDataSet.
Or, perhaps better, intercept 'from dataset' in cur.execute:
# from biz:
cur = self.getTempCursor("select pk, name, zip from customers where zip = ?",
(zip,))
cur.execute("select zip, count(*) from dataset group by 1")
The basic problem is that I want to do sub-queries against the existing
dataset, but
I want to interact with a full dCursor object and not a dDataSet object.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]