#1159: 1 to many grid not saving new entries
----------------------+-----------------------------------------------------
Reporter: pmcnary | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: 0.8.3
Component: biz | Version: 0.8.3
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Old description:
> Paul McNett worked with me on this
> When self.Form.new() is executed after filling in data in grid. Child
> data is not saved. Exchange between Paul and me:
> Paul McNary wrote:
> > Paul McNett wrote:
> >> Paul McNary wrote:
> >>> Paul McNett wrote:
> >>>> print self.Form.PrimaryObject.getChildren()
> >>
> >>> print self.Form.PrimaryBizobj.Children
> >>> self.Form.PrimaryBizobj.Children[0].save()
> >>
> >> There's no Children property. Do this:
> >>
> >> print self.Form.PrimaryBizobj.getChildren()
> >> self.Form.PrimaryBizobj.getChildren()[0].save()
> >>
> >> Paul
> >>
> >>
> > OK now we are getting someplace
> >
> > (<__builtin__.Publiccmpd_IngredientsBizobj (baseclass dabo.biz.dBizobj,
> id:154304300)>,)
> > Traceback (most recent call last):
> > File "/usr/lib/python2.4/site-
> packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dControlMixin.py", line 26, in
> _onWxHit
> > self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
> > File "/usr/lib/python2.4/site-
> packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dPemMixin.py", line 915, in
> raiseEvent
> > super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
> **kwargs)
> > File "/usr/lib/python2.4/site-
> packages/Dabo-0.8.4-py2.4.egg/dabo/lib/eventMixin.py", line 93, in
> raiseEvent
> > bindingFunction(event)
> > File "/tmp/tmpFcsAwc.py", line 443, in onHit
> > self.Form.PrimaryBizobj.getChildren()[0].save()
> > File "/usr/lib/python2.4/site-
> packages/Dabo-0.8.4-py2.4.egg/dabo/biz/dBizobj.py", line 382, in save
> > cursor.save()
> > File "/usr/lib/python2.4/site-
> packages/Dabo-0.8.4-py2.4.egg/dabo/db/dCursorMixin.py", line 1131, in
> save
> > raise dException.NoRecordsException, _("No data to save")
> > dabo.dException.NoRecordsException: No data to save
> >
> >
> > Ok I have a grid that has it's DataSource as public.cmpd_ingredients
> >
> > a Column with a DataField property of:
> > itemsequence
> >
> > When I Add a new record to a form it activates a line in the grid for
> entry. I have been entering data in the grid then hitting the form save
> button.
>
> do a:
>
> print self.Form.PrimaryBizobj.getChildren()[0].getDataSet()
>
> Paul
>
> A Gzip tar file attached with app directory structure.
> A createsql.sql for postgresql is also in the compound directory.
>
> Steps to reproduce
>
> python main.py
>
> Hit ADD New button
> Enter data in form including grid
> Hit SAVE button.
>
> Debug code that Paul had me add is still in place.
> Dabo 0.8.4 4111
>
> Thank you
New description:
{{{
#!text
Paul McNett worked with me on this
When self.Form.new() is executed after filling in data in grid. Child data
is not saved. Exchange between Paul and me:
Paul McNary wrote:
> Paul McNett wrote:
>> Paul McNary wrote:
>>> Paul McNett wrote:
>>>> print self.Form.PrimaryObject.getChildren()
>>
>>> print self.Form.PrimaryBizobj.Children
>>> self.Form.PrimaryBizobj.Children[0].save()
>>
>> There's no Children property. Do this:
>>
>> print self.Form.PrimaryBizobj.getChildren()
>> self.Form.PrimaryBizobj.getChildren()[0].save()
>>
>> Paul
>>
>>
> OK now we are getting someplace
>
> (<__builtin__.Publiccmpd_IngredientsBizobj (baseclass dabo.biz.dBizobj,
id:154304300)>,)
> Traceback (most recent call last):
> File "/usr/lib/python2.4/site-
packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dControlMixin.py", line 26, in
_onWxHit
> self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
> File "/usr/lib/python2.4/site-
packages/Dabo-0.8.4-py2.4.egg/dabo/ui/uiwx/dPemMixin.py", line 915, in
raiseEvent
> super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
**kwargs)
> File "/usr/lib/python2.4/site-
packages/Dabo-0.8.4-py2.4.egg/dabo/lib/eventMixin.py", line 93, in
raiseEvent
> bindingFunction(event)
> File "/tmp/tmpFcsAwc.py", line 443, in onHit
> self.Form.PrimaryBizobj.getChildren()[0].save()
> File "/usr/lib/python2.4/site-
packages/Dabo-0.8.4-py2.4.egg/dabo/biz/dBizobj.py", line 382, in save
> cursor.save()
> File "/usr/lib/python2.4/site-
packages/Dabo-0.8.4-py2.4.egg/dabo/db/dCursorMixin.py", line 1131, in save
> raise dException.NoRecordsException, _("No data to save")
> dabo.dException.NoRecordsException: No data to save
>
>
> Ok I have a grid that has it's DataSource as public.cmpd_ingredients
>
> a Column with a DataField property of:
> itemsequence
>
> When I Add a new record to a form it activates a line in the grid for
entry. I have been entering data in the grid then hitting the form save
button.
do a:
print self.Form.PrimaryBizobj.getChildren()[0].getDataSet()
Paul
A Gzip tar file attached with app directory structure.
A createsql.sql for postgresql is also in the compound directory.
Steps to reproduce
python main.py
Hit ADD New button
Enter data in form including grid
Hit SAVE button.
Debug code that Paul had me add is still in place.
Dabo 0.8.4 4111
Thank you
}}}
Comment (by paul):
Added text format processor for better display of the description
--
Ticket URL: <http://trac.dabodev.com/ticket/1159#comment:2>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo
_______________________________________________
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]