Ed Leafe wrote:
> On Jan 29, 2009, at 2:16 PM, Paul McNett wrote:
> 
>> Here's what I get this morning:
> 
> 
>       No time to dig into this now, but is new() creating a dDataSet or a  
> plain tuple of dicts?

I think this problem has uncovered a long-standing problem, but I have 
no more time to look into this right now.

Apparently, adding a dDataSet instance to a dDataSet instance results in 
a new tuple, not a new dDataSet.

I tested by making dCursorMixin._records a property instead of an 
attribute, using this patch:

{{{
Index: dCursorMixin.py
===================================================================
--- dCursorMixin.py     (revision 4988)
+++ dCursorMixin.py     (working copy)
@@ -2547,7 +2547,16 @@
                assert isinstance(val, dict)
                self._virtualFields = val

+       def _getR(self):
+               return self._R

+       def _setR(self, v):
+               assert isinstance(v, dDataSet)
+               print type(v)
+               self._R = v
+
+       _records = property(_getR, _setR)
+
        AutoPopulatePK = property(_getAutoPopulatePK, _setAutoPopulatePK, None,
                        _("When inserting a new record, does the backend 
populate the PK 
field?"))
}}}

Then running my app (any app that calls new()) results in:

{{{
> Traceback (most recent call last):
>   File "ui/DlgEditProductionOrderOpening.py", line 715, in <module>
>     bizCustomers.new()
>   File "/home/pmcnett/dabo/dabo/biz/dBizobj.py", line 811, in new
>     self._CurrentCursor.new()
>   File "/home/pmcnett/dabo/dabo/db/dCursorMixin.py", line 1506, in new
>     self._records += dDataSet((blank,))
>   File "/home/pmcnett/dabo/dabo/db/dCursorMixin.py", line 2556, in _setR
>     assert isinstance(v, dDataSet)
> AssertionError
}}}

I *think* we need to override dDataSet.__new__() to return a dDataSet 
instance, not a tuple instance.

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]

Reply via email to