Ticket #1159 (new defect)

Opened 4 years ago

Last modified 1 year ago

1 to many grid not saving new entries

Reported by: pmcnary Assigned to: somebody
Priority: major Milestone: 0.8.3
Component: biz Version: 0.8.3
Keywords: Cc:

Description (Last modified by paul)

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

Attachments

compound.tar.gz (5.4 kB) - added by pmcnary on 07/11/08 16:48:52.

Change History

07/11/08 16:48:52 changed by pmcnary

  • attachment compound.tar.gz added.

07/11/08 17:53:31 changed by pmcnary

Version is Dabo 4272M on Python 2.4

10/26/08 13:34:58 changed by paul

  • description changed.

Added text format processor for better display of the description

02/03/11 10:05:49 changed by paul

Can someone with postgres installed please test this? I have a hunch it's been long-fixed, but would like to follow up if possible.